Pages

Friday, May 5, 2017

Downgrading Mysql 5.7 to Mysql 5.6

I just got a new system where I installed mysql through apt-get. It installed 
mysql version 5.7, which unfortunately didn't serve my purpose well. That 
version added a new constraint such that when there's a GROUP BY keyword in a
SELECT clause, the only columns that can be selected are those that are part of
GROUP BY. 

I could possibly disable the constraint, but I just felt like sticking with
version 5.6 which had been working fine for me. Because of this, I decided to
downgrade to 5.6.
Step 1. Remove all 5.7 components. The second line is important, because
it seems that there are some settings that if not deleted, version 5.6 wouldn't
run.
sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.7 mysql-client-core-5.7
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean
Step 2. Install version 5.6
 sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty universe'
 sudo apt-get update
 sudo apt install mysql-server-5.6 * see note below if you get an error
 sudo apt install mysql-client-5.6
Step 3. Restart the service
sudo service mysql stop
sudo service mysql start

1 comment: