MySQL Upgrade from 5.5 to 5.6 fails and prevents a clean install.

August 26, 2015 1.8k views
MySQL Linux Commands


Followed both sets of instructions from the link above to upgrade MySQL from version 5.5 to 5.6. I put a tail on the MySQL error.log file, and the error that appears each time is:

ERROR: 1062 Duplicate entry 'innodb' for key 'PRIMARY'

Since my DBs were brand new, I was willing to lose data, so i performed several versions of a clean uninstall using remove, purge, and autoremove and even used regex on the uninstall attempts (ex. sudo apt-get remove mysql-server-). After the uninstall attempts, i ran *dpkg --get-selections** to ensure that the packages were no longer installed. Unfortunately, every subsequent install of 5.5 or 5.6 produces the exact same error.

My guess is that there's a file or config that I am not removing, but purge is supposed remove all configs. My other guess is that the packages under apt-get are bad and I need to download (wget) and use a local repository. I may be way off, but this is where I have landed.

One last thing to add...searching online for this error during upgrades, it appears that the package attempts to resolve DB names in a case insensitive way. There is a command to convert all DBs to LOWER({dbname}). So, if InnoDB exists in PRIMARY, the package attempts to add innodb to PRIMARY which would produce the duplicate key. Unfortunately, without being able to install or start the service, I can't figure out where the duplicate entry is going.

I have plenty of tech experience, but a bit of a Linux noob, so don't be afraid to go under the hood. I can handle it. Hopefully, the aforementioned shows that I have done my due diligence to research and find a resolution(s) to the issue(s) on my own before coming to the community. Any help would be greatly appreciated. Thanks.

  • possum
2 Answers

Can you try and remove /var/lib/mysql ?

Have another answer? Share your knowledge.