Search code examples
mysqlphpmyadminxamppmariadb

Problems in creating stored procedure in phpmyadmin, column count mysql.proc is incorrect


Trying to create simple stored procedure in phpmyadmin through 'Routines' tab as

BEGIN SELECT * FROM tbl_user; END

throws errors as Column count of mysql.proc is wrong,expected 21 found 20, please use mysql_upgrade to fix this error

What I already tried

1 - tried couple of way to use mysql_upgrade , but as I am using xampp I was not able to find a way to upgrade mysql as mysql is replaced by maridb

2 - tried upgrading phpmyadmin to latest by following this

3 - Uninstalled xampp and installed latest version '7.3.8'

4 - Formatted the system and installed latest ubuntu '19.04' (lol that was't needed though)

5 - tried to make changes in mysql.proc, added new column as 'aggregate' , which I found here now which throws error as can not load from mysql.proc, the table is probably corrupted

Now I am left with only one option which is uninstall xampp and install mysql workbench.

I am using xampp as most of my projects are php based, How can I use mysql_upgrade Or can fix this issue Any help would really appreciate.


Solution

  • Thanks for commenting @nbk
    your link gave me a way to fix this issue
    Any one who is facing same issue here is the answer you can access mysql in the terminal using

    1. /opt/lampp/bin/mysql -u root -p
    2. after that enter the mysql user password if it worked well then type exit
    3. and now type sudo /opt/lampp/bin/mysql_upgrade -u root -p , enter your password and tadam , here is your mysql upgraded

    really appreciate your help @Bohemian, @nbk, Now I am able to create the Stored Procedure without facing any issue