Skip to content

MySQL Upgrade To 5.1: Database Name Prefix #mysql50#

If you've upgraded from a MySQL version prior to 5.1, to a MySQL version of 5.1 or later, you might find some of your databases have their names altered to "#mysql50#dbname", where it used to be just "dbname".

This is because in MySQL 5.1 the data directory structure changed.

You can either alter your queries, so you retrieve from the database "#mysql50#dbname", or you can be sane and do the following query to upgrade the data directory structure. Note; this assumes you have shell access to the server with enough privileges! If you don't, please contact your server administrator.

mysql > ALTER DATABASE `#mysql50#dbname` UPGRADE DATA DIRECTORY NAME;

Note the backticks (`), that's not a single quote.

You might run into the following error when you first do so:

ERROR 1558 (HY000): Column count of mysql.proc is wrong. Expected 20, found 16. 
Created with MySQL 50077, now running 50148. Please use mysql_upgrade to fix this error.

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

# mysql_upgrade -h localhost -u root -p

For Plesk environments, you can use

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

This will update the necessary database entries to the latest version of MySQL. Chances are, this will even have fixed the '#mysql50#' database prefix for you. If it hasn't, return to the first step here.

More information can be found at the bottom of MySQL's Documentation on the ALTER DATABASE command.

Comment Feed

11 Responses

  1. Google in USA got me here, and this is exactly what I needed. Thank you for this, very helpful.

  2. Thank you! :)

  3. Cheers Matti! You saved me a great deal of headaches…

  4. Excelente aporte, me ha ayudado a resolver un problema enorme por haber actualizado a mysql 5.1.50.el5art

    Gracias por la ayuda

  5. Thanks!

  6. EXCELLENT! This was driving me mad and I couldnt find it anywhere on the MySQL site. THANKS!!!

  7. Thanks for the explination. Our host updated MySQL without notice and it killed two of our databases without warning us.

  8. Thanks…….I have solved my problem.

  9. Thanks mate… Good info, the plesk call did take care of the renaming.

    Saved my day.

  10. why mysql execute “# mysql_upgrade -h localhost -u root -p”, the problem also not be solved .
    hint :
    Column count of mysql.proc is wrong. Expected 20, found 16. Created with MySQL 50027, now running 50148. Please use mysql_upgrade to fix this error.

    Who can help me .ths.

    • Did you complete the “mysql_upgrade” command with correct username and password? You should retrieve a lot of output saying it’s fixing tables.



Some HTML is OK

*

or, reply to this post via trackback.