How can I downgrade mysql 5.7 to 5.6 on Ubuntu 16.04?

Solution 1:

First make a mysqldump of all your databases (including information_schema). Then "stop" mysql" and this will remove anything related to mysql:

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.7 mysql-client-core-5.7

# Backup 5.6 config and data without deleting
sudo mv /etc/mysql /etc/mysql-5.6-backup
sudo mv /var/lib/mysql /var/lib/mysql-5.6-backup
sudo apt-get autoremove
sudo apt-get autoclean

and then

sudo apt-get install mysql-client-5.6
sudo apt-get update

Warnings:

  • Ubuntu switched to systemd with 16.04. You may need to start 16.04 with upstart too when using mysql 5.6.