10

I recently had my MySQL server upgraded from 5.1 to 5.5 and I'm trying to upgrade my databases using mysql_upgrade but I keep getting this error:

[root@ip-??-???-???-??? ~]# mysql_upgrade -uadmin -p
Enter password:
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
FATAL ERROR: Upgrade failed

I can't figure why this won't run. MySQL Server is running.

1
  • Try adding --verbose to the mysql_upgrade and see if that shows anything. Try doing this while the server is not running and see if that makes a difference. Related thread on sf: serverfault.com/questions/527422/… Commented Mar 21, 2014 at 16:57

9 Answers 9

21

I had the same issue going from MySQL 5.5 to 5.6 on OS X (installed via MacPorts).

Seems that mysql_upgrade needs to be run as user root and only root and a password needs to be set up for the user. Any other user with administrative privileges does not seem work.

So the only valid command seems to be: mysql_upgrade -u root -p

Initial solution by Chris_H at FreeBSD forums.

Sign up to request clarification or add additional context in comments.

2 Comments

In fact, it works with other user with sufficients privileges, but you have to let the password empty. You'll have a prompt to type it after command execution.
@Groco - yes, -p implies the password prompt. So yes, might work with other administrator accounts as well provided that the password is not supplied as an argument of the execution.
8

Worked for me, but I had to use this:

mysql_upgrade --port=3306 --user=root --password=PASSWORD

I work on

mysql -V

mysql Ver 14.14 Distrib 5.5.35, for debian-linux-gnu (x86_64) using readline 6.3

Comments

3

For my case, I need to pass my socket file location explicitly.

mysql_upgrade -S /usr/local/mysql/mysql.sock

Comments

2

If you run MySQL on a non-standard port be sure to include --port=xxxxxx

I found that skipping that can cause the error you're getting.

Comments

2

The FATAL ERROR is solved:

1º - Execute shell command: service mysqld stop

2º - Then, rename /etc/my.cnf to /etc/my.cnfbkp

3º - Execute shell command: service mysqld start

4º - Execute shell command: mysql_upgrade -u root -p YOUR_ROOT_PASSWORD

5º - Rename /etc/my.cnfbkp to /etc/my.cnf

6º - Execute shell command: service mysqld restart

Comments

0

My installation on Windows server requires port and user/pass specification.

--port=3306 --user=root --password=XXXX

1 Comment

Not sure why my comment was edited, you have to define the password after the --password switch.
0

Just add the configuration line to your my.cnf At the end add

[mysqlcheck] socket = /dbabcstorage/data/mysql5/mysql.sock

the correct value you can copy in the previous lines of my.cnf

Comments

0

This worked for me on a CentOS/Plesk server:

mysql_upgrade -uadmin -p< /etc/psa/.psa.shadow -f

service mysqld restart

http://kb.sp.parallels.com/en/427

1 Comment

Thank you. This is what I was looking for. Hope it helps someone else.
0

SOLVED!

Follow the steps as ADMINISTRATOR account:

1) Install MySQL

2) In the my.ini file, located on the MySQL path, set datadir e basedir

3) Move ALL THE CONTENT of "%MySQL%/Data" folder to the datadir above

4) Run the upgrade:

mysql_upgrade

5) Create Windows Service like this:

sc create MySQL binPath=C:/MySQL

To remove the Windows Service:

sc delete MySQL

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.