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


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
Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

This comment has been deleted

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