Bug #70441 mysql_upgrade needs username & password when it shouldn't
Submitted: 26 Sep 2013 19:19 Modified: 3 Oct 2013 17:42
Reporter: Peter Brawley (Basic Quality Contributor) Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.7.2 OS:Windows (win 7 64-bit)
Assigned to: CPU Architecture:Any

[26 Sep 2013 19:19] Peter Brawley
After starting the server with ...

C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" --console --skip-grant-tables

it is supposed to be possible to run mysql_upgrade without a username & password. 

However, running mysql_upgrade without a username & password fails with a password-required error message from mysqlcheck, which will run if and only if supplied a username & password, --skip-grant-tables notwithstanding.

Once mysql_upgrade has run successfully, and still with the server running under --skip-grant-tables, repeated attempts to run mysql_upgrade -- force without username & password fail with this useless error message ...

Looking for 'mysqlcheck.exe' as: C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqlcheck.exe
FATAL ERROR: Upgrade failed

How to repeat:
As above
[26 Sep 2013 19:22] MySQL Verification Team
fwiw, after 'flush privileges' is run, --skip-grant-tables doesn't take effect anymore...
[3 Oct 2013 11:35] MySQL Verification Team
Hello Peter,

Thank you for the bug report.
Imho this is a documented behavior as Shane pointed out in the previous note.

Please confirm/reference the manual page for more details on this behavior : http://dev.mysql.com/doc/refman/5.7/en/server-options.html#option_mysqld_skip-grant-tables

[3 Oct 2013 17:09] Peter Brawley
Less defensiveness would be good. If mysql_upgrade silently issues FLUSH PRIVLEGES, thereby voiding the effect of --skip-grant-tables, that's a stupid contradiction that has been built into the upgrade process. It should be fixed. Failing that, the documentation on upgrades needs to be much clearer on the point.