When Upgrading to 5.1.73, 5.5.35+, 5.6.15+, 5.7.3+ mysql_upgrade Fails With Error 1062 (23000); Duplicate entry for key 'PRIMARY' For the mysql.user Table (Doc ID 1636788.1)

Last updated on MARCH 08, 2017

Applies to:

MySQL Server - Version 5.1 to 5.7 [Release 5.1 to 5.7]
MySQL Cluster - Version 7.1 to 7.3 [Release 7.1 to 7.3]
Information in this document applies to any platform.

Symptoms

When attempting to run mysql_upgrade after upgrading to

the following error occurs:

 

When checking the mysql.user table, at least one user name has another account with the same host name except for the capatilization of the host name, for example root@localhost and root@LOCALHOST.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms