Please use mysql_upgrade to fix this error. (1558)

that just doesn’t sound right, does it. I just now noticed it when I ran my cron backup manually. Complete error is:

mysqldump: Couldn’t execute ‘SHOW FUNCTION STATUS WHERE Db = ‘your-db-here”: Column count of mysql.proc is wrong. Expected 20, found 16. Created with MySQL 50077, now running 50152. Please use mysql_upgrade to fix this error. (1558)

so I ran mysql_upgrade , errored about password, then I ran mysql_upgrade -p and all was ok. Well, at least from the script point of view.

Running the backup again revealed another error:

Cannot proceed because system tables used by Event Scheduler were found damaged at server start (1577)

Reading about it on the net, somebody suggested a mysql restart after running the mysql_upgrade script adn what do you know, it did it.

Do note that you need to be logged as root for that command line to work. Otherwise, make sure to specify root user in the command line.

One thing that I did notice a while ago was that the “all” backup (which dumps all tables) was failing, but I didn’t give it too much attention since the per-table backups were ok. Seems this upgrade thing solved that issue as well.

This one was simple :)

Related posts

Tags: ,

9 Responses to “Please use mysql_upgrade to fix this error. (1558)”

  1. Larry says:

    Thank you so much for this! I was trying to perform a data transfer from one host to another and encountered the exact same problem.

    I also needed to specify a user with the password:

    > mysql_upgrade -u admin_larry -p;

    then…

    > service mysqld restart

    and all is well :)

  2. Ratheesh says:

    Thank you very much for your blog.You saved my valuable time to get resolve this issue as I am not able to take backup of any of my data bases.

    all working charm now

  3. Marko says:

    I had this problem for months untill I decide to look on google for it and your solution works perfect! Thank you

  4. René Madsen says:

    To fix this, run the following on the server’s command line.

    srv # mysql_upgrade -h localhost -u root -p

    # For Plesk environments

    srv # mysql_upgrade -h localhost -u admin -p`cat /etc/psa/.psa.shadow

  5. Faardeen says:

    Thank you for this solution. It works great. I was having the same problem.

  6. Peter says:

    So I tried running this… and I get an error:

    mysql_upgrade -h localhost -u root -p
    Enter password:
    Looking for ‘mysql’ as: mysql
    Looking for ‘mysqlcheck’ as: mysqlcheck
    sh: -c: line 0: unexpected EOF while looking for matching `”
    sh: -c: line 1: syntax error: unexpected end of file
    Running ‘mysqlcheck’ with connection arguments: ‘–host=localhost’
    sh: -c: line 0: unexpected EOF while looking for matching `”
    sh: -c: line 1: syntax error: unexpected end of file
    FATAL ERROR: Upgrade failed

    • ciuly says:

      looking over some google search results, the most probable cause would be that you have mysql fed from multiple repositories. You will have to somehow undo updates from the alien repos and then try again.
      Other than that, no clue what could cause it. If that doesn’t work, hit the mysql forum maybe you get luckier ;)

  7. classified ads says:

    Hi,

    -bash: mysql_upgrade: command not found

    can I do that?

Leave a Reply

Comment Spam Protection by WP-SpamFree