Bug #54387 should not create a mysql_upgrade_info file if --host option is not local addr
Submitted: 10 Jun 2010 6:49 Modified: 10 Jun 2010 9:31
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.1.47, 5.6.99, all OS:Any
Assigned to: CPU Architecture:Any
Triage: Triaged: D3 (Medium)

[10 Jun 2010 6:49] Shane Bester
Description:
This is an addition to bug #37169 and not a duplicate.

If you're upgrading instances with mysql_upgrade and you specify a remote host using the --host= option, then the application still tries to write a file on the local machine where mysql_upgrade is run.

If the path doesn't exist, it'll be harmless and fail like this;

Running 'mysql_fix_privilege_tables'...
OK
Could not create the upgrade info file '\home\sbester\big\mysql\5.1\mysql-advanced-gpl-5.1.47-linux-x86_64-glibc23\data\mysql_upgrade_info' in the MySQL Servers datadir, errno: 2

However, if the datadir is in some standard location, the upgrade script might
incorrectly skip an upgrade next time since the file is found (Even though --host points to un-upgraded instance!)

How to repeat:
./mysql_upgrade --host=<ip of remote instance>

Suggested fix:
do not write or check the mysql_upgrade_info file if a remote host is given.
[10 Jun 2010 7:35] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior: mysql_upgrade_info is on remote server. Have you specified --port or --protocol=TCP option when connected to remote server?
[10 Jun 2010 9:31] Sveta Smirnova
Ignore last comment.

I tested on NFS filesystem and file created in proper datadir because this. Verified as described by reading source code.
[10 Jun 2010 9:38] Sveta Smirnova
Workaround: use --force.
[30 Sep 2014 13:33] Hartmut Holzgraefe
does the 5.7 rewrite of mysql_upgrade solve this?