Bug #77803 mysql_upgrade: FATAL ERROR: Upgrade failed - improve error

Submitted: 22 Jul 2015 23:37 Modified: 29 Oct 2015 12:47
Reporter: Jesper wisborg Krogh Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.6 OS:Any
Assigned to: CPU Architecture:Any

[22 Jul 2015 23:37] Jesper wisborg Krogh
Description:
When doing an upgrade, you execute mysql_upgrade. If mysql_upgrade fails to connect or it connects with a user without the proper privileges, it will return the error:

    FATAL ERROR: Upgrade failed

which is not very informative.

How to repeat:
shell$ mysql_upgrade --socket=... --user=root --password
Enter password: <enter wrong password>
Looking for 'mysql' as: ./mysql/bin/mysql
Looking for 'mysqlcheck' as: ./mysql/bin/mysqlcheck
FATAL ERROR: Upgrade failed

mysql> CREATE USER upgrade@localhost IDENTIFIED BY 'some_password';
shell$ mysql_upgrade --socket=... --user=upgrade --password
Enter password: <enter correct password>
Looking for 'mysql' as: ./mysql/bin/mysql
Looking for 'mysqlcheck' as: ./mysql/bin/mysqlcheck
FATAL ERROR: Upgrade failed

Suggested fix:
Provide an error message that explains mysql_upgrade failed to connect. E.g. include an error similar to what the mysql command line client output:

   $shell mysql --socket=... --user=root --password
   Enter password: <enter wrong password>
   ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

and similar if the user doesn't have the right privileges.
[29 Oct 2015 12:47] Paul DuBois
Noted in 5.5.47, 5.6.28, 5.7.10, 5.8.10 changelogs.

mysql_upgrade now attempts to print more informative errors than
FATAL ERROR: Upgrade failed.
[29 Oct 2015 20:55] Paul DuBois
Correction:
Noted in 5.5.47, 5.6.28, 5.7.10, 5.8.0 changelogs (not 5.8.10).

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.064 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.