Bug #76757 mysql_upgrade fails with show_compatibility_56 = OFF
Submitted: 20 Apr 2015 14:30 Modified: 5 May 2015 15:18
Reporter: Mattias Jonsson Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[20 Apr 2015 14:30] Mattias Jonsson
Description:
If show_compatibility_56 is set to OFF then will mysql_upgrade fail since it relies on "SELECT * FROM information_schema.global_variables WHERE variable_name like 'version'".

Workaround is to use --skip-version-check

How to repeat:
mtr test:
SET GLOBAL show_compatibility_56 = OFF;
--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1

output:
mysqltest: At line 2: command "$MYSQL_UPGRADE --skip-verbose --force 2>&1" failed

Output from before failure:
Error: Server version () does not match with the version of
the server (5.7.8-rc) with which this program was built/distributed. You can
use --skip-version-check to skip this check.
exec of 'xxx/mysql_upgrade.exe --defaults-file=xxx/mysql-test/var/my.cnf --skip-verbose --force 2>&1'
failed, error: 3, status: 3, errno: 0

Suggested fix:
Check if @@global.show_compatibility_56 is on or off and depending of the result query information_schema or performance_schema.
Or simply use 'SELECT VERSION();'
[5 May 2015 15:18] Paul DuBois
Noted in 5.7.8, 5.8.0 changelogs.

mysql_upgrade failed if the show_compatibility_56 system variable was
enabled.