Bug #81352 Empty sys database prevents mysql_upgrade of sys schema
Submitted: 9 May 2016 9:36 Modified: 10 May 2016 13:34
Reporter: Magnus Blåudd Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: SYS Schema Severity:S3 (Non-critical)
Version:5.7.12 OS:Any
Assigned to: CPU Architecture:Any

[9 May 2016 9:36] Magnus Blåudd
Description:
Running mysql_upgrade on a mysqld which have an empty "sys" database refuses to create the sys schema saying that sys is a user created database and should not be overwritten. This is a little to strict and we shoudl allow the sys schema to be created when an empty sys database already exists.

How to repeat:
mysql> CREATE DATABASE sys;
$> mysql_upgrade
Error occurred: A sys schema exists with no sys.version view. If you have a
user created sys schema, this must be renamed for the upgrade to succeed.

Suggested fix:
Allow the sys schema to be created even if an empty sys database already exists.
[10 May 2016 13:34] Paul DuBois
Posted by developer:
 
Noted in 5.7.14 changelog.

mysql_upgrade failed to upgrade the sys schema if a sys database
directory existed but was empty.