Tomas Kubes
Tomas Kubes

Reputation: 25108

mysql_upgrade and MySQL service - Vicious Circle

I am upgrading MySQL server 5.067 to 5.5.60 on Windows 10.

I stopped the service, replaced bin a shared directory and started the service.

Service start failed with the message (in Event Viewer):

Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
For more information, see Help and Support Center at http://www.mysql.com. 

OK, so I opened cmd as admin with the command:

mysql_upgrade --port 64202

With result:

Looking for 'mysql.exe' as: C:\Program Files (x86)\XXX\MySQLServer\bin\mysql.exe
Looking for 'mysqlcheck.exe' as: C:\Program Files (x86)\XXX\MySQLServer\bin\mysqlcheck.exe
Error: Failed while fetching Server version! Could be due to unauthorized access.
FATAL ERROR: Upgrade failed

The design of MySQL upgrade is connecting over TCP to MySQL to run the upgrade, but how it can possibly work if the service is not running? It is a vicious circle - MySQL service needs to be upgraded to be able to start and mysql_upgrade needs to connect to running service.

What is wrong?

Upvotes: 0

Views: 1094

Answers (2)

Rick James
Rick James

Reputation: 142298

Skipping major versions (5.1) is not supported, and may or may not work. The appropriate upgrade is one of:

Plan A: Upgrade to 5.1, then to 5.5. Run mysql_upgrade at each step.

Plan B: Dump the data from 5.0 with mysqldump. (Be sure to get routines, etc). Blow away (or bypass) 5.0 and install a fresh 5.5. Load the data back in. There may be syntax errors in the dump file, edit the file if needed.

Upvotes: 2

smile
smile

Reputation: 78

Since you're upgrading from 5.0 to 5.5, there are configuration values which are deprecated, causing the engine to be unable to start.

Most likely culprit is skip-dbd, as explained on this site.

So: find your MySQL configuration file, comment out the skip-dbd option and restart the MySQL service. Then you can run mysql_upgrade with the appropriate options including authentication.

Upvotes: 0

Related Questions