Downgrading MySQL 5.7 to MySQL 5.6 on Ubuntu Trusty 64

trusty
mysql

#1

How to downgrade?

We didn’t expect the change from 5.6 to 5.7 over this weekend, our app doesnt support 5.7 (incompatible group by issues)


#2

Also trying to downgrade to 5.6 because our builds failsfor 5.7. There’s been some responses for the following thread but I don’t think a solid solution has been introduced…


#3

Please see:


#4

It also broke the build for us.

@justinlee46 the incompatible group issue might be solved by this setting?

test:
  pre:
    - echo "SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));" | mysql 

#5

I also had incompatibility problems with 5.7 in an older project. I ended up (ab)using circle’s docker support to install mysql 5.6 on the machine, and then pointed my application to that:

machine:
  services:
    - docker
dependencies:
  pre:
    - docker run -e MYSQL_ALLOW_EMPTY_PASSWORD=1 -p 3307:3306 -d mysql:5.6

That will start up a mysql 5.6 server o port 3307, with the root username and no password. Now you just need to configure your application to point to that instead of the default port of 3306


#6

This method works great, but instead what I would recommend doing is removing mysql-community-server from the CircleCI box totally in the dependencies -> pre node and that way you can bind 3306 directly into the container.

machine:
  services:
    - docker
dependencies:
  pre:
    - sudo apt-get remove mysql-community-server
    - docker run -e MYSQL_ALLOW_EMPTY_PASSWORD=1 -p 3306:3306 -d mysql:5.6

This way none of your default application configs will have to change, it is just a drop in replacement.


#7