We recently ran into an issue in which after a migration, several of the clients db names were prepended with the #mysql50# prefix. The db names were formatted as: “#mysql50#dbname”, where it used to be just “dbname”. The clients previous version of MySQL was 5.0 and the new servers MySQL version was 5.1.
Evidently, the change was made internally by MySQL 5.1 because the data directory structure changed between MySQL versions.
To repair this issue, you can either change your queries to retrieve from the new db named “#mysql50#dbname” or you can run this query to upgrade the data directory structure.
(Assuming you have root access)
(Note the backticks (`), that’s not a single quote.)
If you run into the following error:
Created with MySQL 50077, now running 50148. Please use mysql_upgrade to fix this error.
run the following command:
If running in a Plesk environment:
This will update the necessary database entries to the latest version of MySQL. This may also fix the ‘#mysql50#’ database prefix issue. If issues persist, rerun the first step.
More information can be also found at MySQL’s Documentation on the ALTER DATABASE command.
Infoz and thanks go to mattiasgeniar.be