Bug #72066 | mysql_upgrade duplicate key error for mysql.user for 5.5.35+, 5.6.15+, 5.7.3+ | ||
---|---|---|---|
Submitted: | 18 Mar 2014 1:54 | Modified: | 27 Aug 2014 23:11 |
Reporter: | Jesper wisborg Krogh | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Installing | Severity: | S3 (Non-critical) |
Version: | 5.1.73 5.5.35 5.6.15 5.7.3 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[18 Mar 2014 1:54]
Jesper wisborg Krogh
[27 Aug 2014 23:11]
Paul DuBois
Noted in 5.5.40, 5.6.21, 5.7.5 changelogs. mysql_upgrade could fail if the mysql.user table contained multiple accounts with the same user name and host name where the host name differed in lettercase. This is still not permitted, but now mysql_upgrade prints a more informative error message to indicate the nature of the problem: ERROR 1644 (45000): Multiple accounts exist for user_name, host_name that differ only in Host lettercase; remove all except one of them
[24 Sep 2014 7:55]
Laurynas Biveinis
revno: 4693 committer: Venkata Sidagam <venkata.sidagam@oracle.com> branch nick: 5.5 timestamp: Fri 2014-08-01 14:18:28 +0530 message: Bug #18415196 MYSQL_UPGRADE DUPLICATE KEY ERROR FOR MYSQL.USER FOR 5.5.35+, 5.6.15+, 5.7.3+ Description: mysql_upgrade fails with below error, when there are duplicate entries(like 'root'@'LOCALHOST' and 'root'@'localhost') in mysql.user table. ERROR 1062 (23000) at line 1140: Duplicate entry 'localhost-root' for key 'PRIMARY' FATAL ERROR: Upgrade failed Analysis: As part of the bug 12917151 fix we are making all the hostnames as lower case hostnames. So, this has been done by mysql_upgrade. In case of above mentioned duplicate entries mysql_upgrade tries to change hostname to lowercase. Since there is already 'root'@'localhost' exists. it is failing with "duplicate entry" error. Fix: Since its a valid error failure. We are making the error more verbose. So, that user will delete the duplicate errors manually. Along with existing error we are printing below error as well. ERROR 1644 (45000) at line 1153: Multiple accounts exist for @user_name, @host_name that differ only in Host lettercase; remove all except one of them
[24 Sep 2014 7:56]
Laurynas Biveinis
revno: 4694 committer: Venkata Sidagam <venkata.sidagam@oracle.com> branch nick: 5.5 timestamp: Fri 2014-08-01 17:09:55 +0530 message: Bug #18415196 MYSQL_UPGRADE DUPLICATE KEY ERROR FOR MYSQL.USER FOR 5.5.35+, 5.6.15+, 5.7.3+ Follow-up patch. Removed unwanted code.