Today I noticed that MySQL failed to update on one of my droplets, after trying for a while I was unable to get it to successfully update. I tried many different posted solutions but the only way I was able to fix the issue was to backup my databases/users, purge, manually delete files, install MySQL and then restore my backup. Since this appears to be a common issue I would like to post the steps that I took.
Possible Related Bugs:
The Solution (For Me At-least):
1. First you want to backup your databases/tables/users with the following command, you will need your MySQL root password.
mysqldump --lock-all-tables -u root -p --all-databases > dump.sql
2. Next you need to remove the current version of mysql server and do some cleaning up.
sudo apt-get remove --purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
3. Remove any files leftover, you can make a backup if you need to.
sudo rm -r /etc/mysql
sudo rm -r /var/log/mysql
4. Install latest MySQL server.
sudo apt-get install mysql-server
5. Restore your databases/tables/users.
sudo mysql -u root -p < dump.sql
6. Restart service for MySQL server
sudo service mysql restart
After doing all of this I was back in business with everything being up-to-date. If you were able to fix it another way then please post because I would love to find out if there was an easier way to avoid all of this.