Bug #71075 MySQL Installer does not pass non-default port etc to mysql_upgrade and it fails
Submitted: 4 Dec 2013 9:28 Modified: 1 Mar 2018 22:17
Reporter: Valeriy Kravchuk Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL for Windows: Installer Severity:S3 (Non-critical)
Version:5.6.15 OS:Any
Assigned to: CPU Architecture:Any
Tags: mysql_upgrade

[4 Dec 2013 9:28] Valeriy Kravchuk
Description:
Noted errors similar to the following while upgrading from 5.6.10 listening to non-default port 3314 to latest and greatest 5.6.15 via MySQL Installer (that small web .msi) on Windows XP:

C:\Program Files\MySQL\MySQL Server 5.6\bin>mysql_upgrade.exe
Looking for 'mysql.exe' as: C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql.ex
e
Looking for 'mysqlcheck.exe' as: C:\Program Files\MySQL\MySQL Server 5.6\bin\mys
qlcheck.exe
FATAL ERROR: Upgrade failed

So, it seems MySQL Installer, having root password just confirmed and knowing port for sure from service definition and my.ini used there, still does NOT pass this information to mysql_upgrade called in the process. As a result mysql_upgrade is NOT executed and some tables from older version may remain in the bad state. Also poor user gets unclear messages about the failure, while surely there is way to upgrade properly:

C:\Program Files\MySQL\MySQL Server 5.6\bin>mysql_upgrade.exe -uroot -proot -P33
14
Warning: Using a password on the command line interface can be insecure.
Looking for 'mysql.exe' as: C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql.ex
e
Looking for 'mysqlcheck.exe' as: C:\Program Files\MySQL\MySQL Server 5.6\bin\mys
qlcheck.exe
Running 'mysqlcheck' with connection arguments: "--port=3314"
Warning: Using a password on the command line interface can be insecure.
Running 'mysqlcheck' with connection arguments: "--port=3314"
Warning: Using a password on the command line interface can be insecure.
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.general_log                                  OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
...

How to repeat:
Try to upgrade any older MySQL 5.6.x with non-default port setting to 5.6.15 via installer.

Suggested fix:
Pass proper arguments to mysql_upgrade - they are all known to MySQL Installer before mysql_upgrade.exe is called.

In case of failure, give some useful error message or instructions to the user.
[4 Dec 2013 14:50] MySQL Verification Team
Thank you for the bug report.

C:\Program Files\MySQL\MySQL Server 5.6>cd bin

C:\Program Files\MySQL\MySQL Server 5.6\bin>mysql_upgrade.exe
Looking for 'mysql.exe' as: C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql.exe
Looking for 'mysqlcheck.exe' as: C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqlcheck.exe
FATAL ERROR: Upgrade failed
[14 Feb 2014 21:59] Samuele Fontana
same problem here: on windows server 2012 the upgrade from mysql5.6.11 to mysql5.6.16 using mysql installer ends with fatal error while executing the mysql_upgrade process:
mysql-server-5.6-winx64:50 - Attempting to run mysql_upgrade.exe
mysql-server-5.6-winx64:100 - Running process: "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld.exe"--defaults-file="C:\ProgramData\MySQL\MySQL Server 5.6\my.ini" --skip-grant-tables --console
mysql-server-5.6-winx64:100 - 2014-02-14 21:38:16 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mysql-server-5.6-winx64:100 - Warning: Using a password on the command line interface can be insecure.
mysql-server-5.6-winx64:100 - Looking for 'mysql.exe' as: C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql.exe
mysql-server-5.6-winx64:100 - Looking for 'mysqlcheck.exe' as: C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqlcheck.exe
mysql-server-5.6-winx64:100 - FATAL ERROR: Upgrade failed
mysql-server-5.6-winx64:100 - 
mysql-server-5.6-winx64:100 - 
mysql-server-5.6-winx64:100 - Stopping server process: "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld.exe"--defaults-file="C:\ProgramData\MySQL\MySQL Server 5.6\my.ini" --skip-grant-tables --console
mysql-server-5.6-winx64:100 - The mysql_upgrade.exe attempt failed.  Please examine the log file for more details.
mysql-server-5.6-winx64:100 - Product configuration controller finished configuration.
[1 Mar 2018 22:16] Javier TreviƱo
Posted by developer:
 
This has been fixed for a long time since the MySQL Installer bumped to the 1.4.x series.
QA has been testing Server upgrades with non default ports for a long time.