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: ,

20 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?

  8. iraphilp says:

    Initial time I down loaded the plugin, it all worked effectively with all
    the two people I picked to check it appearing while
    in the person index. I then made a couple of changes and now I don’t get these details, just a message which says This can be
    somewhat embarrassing, is not it?’ . The details are there, as
    I can find people via the search alternative.Secondly the marriage
    details of my chosen folks don’t appear, but birth, death and other facts do.
    What do I need to do to rectify these errors?

  9. frank says:

    I just upgraded yesterday night from MySQL 5.5 (5.5.34-0ubuntu0.12.04.1) on Ubuntu 12.04 to MariaDB 5.5 (5.5.34+maria-1) and got this error this morning when my automatic backup script (automysqlbackup) ran.

    mysqldump: Couldn’t execute ‘SELECT /*!40001 SQL_NO_CACHE */ * FROM `EVENTS`': Cannot proceed because system tables used by Event Scheduler were found damaged at server start (1577)
    mysqldump: Couldn’t execute ‘show events': Cannot proceed because system tables used by Event Scheduler were found damaged at server start (1577)…

    I did mysql_upgrade with –force and restarted the mysql server but no effect, still the same error, when I try to SELECT the events table in information_schema.

    Is there some other solution to this?
    Thank you.

    frank

    • ciuly says:

      I’m afraid this could be something related to MariaDB. This is the first time I read about this DB and on mariadb.com I see there are plenty of incompatibilities between it and mysql. I’d go onto their support forums for help with this one.

  10. Slava says:

    Where should I put mysql_upgrade script for running? Could you please provide a link where I can download right mysql_upgrade script and lounch it to upgrade from MySQL 50051 up to 50151?

    • ciuly says:

      you don’t put it anywhere. After you have upgraded your mysql to the new version, you have it installed in /usr/bin/mysql_upgrade and simply run it (/usr/bin should already be in your $PATH if not, just execute it as absolute path /usr/bin/mysql_upgrade )

Leave a Reply

Spam Protection by WP-SpamFree