How to change MySQL/MariaDB version

As per documentation, the default mysql version on CircleCI is 5.5.41.
I’m currently using MySQL statements (INET6_ATON) that require MySQL version 5.6 and above.

On top of that, our production environment is running 10.0.21-MariaDB-1~wheezy.

In circle.yml, it is easy to choose the PHP or Node versions. You just add

    version: 5.5.21

    version: 4.1.0

…But currently CircleCI does not support defining the MySQL version this way.
So 2 questions:

  • How to specify the MySQL version in CircleCI ?
  • How to change the database from MySQL to MariaDB ?


What I’ve already tried:

Error installing MySQL 5.6
This is not working, getting the following error:
sudo apt-get update; sudo DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server-5.6 returned exit code 100

Installing MySQL 5.7
I was able to install MySQL 5.7 using the command below. This way my tests run fine again. yay.

export DEBIAN_FRONTEND=noninteractive && curl -sSL | sh

However I am still interested in hearing how I can easily pick ANY MySQL version, or how I can use the MariaDB database architecture

1 Like

In the FAQ we suggest installing MySQL 5.6 like this:

    - sudo apt-add-repository -y 'deb precise
    - sudo apt-get update; sudo DEBIAN_FRONTEND=noninteractive apt-get
      install -y mysql-server-5.6

There is no easy way to pick the MySQL version right now, but we’ll see what we can do about that in the future.


I am also experiencing issues with this. Specifically, I need to install 5.6.28.

This is what our circle.yml looks like for instaling MariaDB 5.5. It took us some time to set this up correctly, so hopefully this helps. You should be able to adapt for your specific version of MariaDB

    - sudo apt-get install python-software-properties
    - sudo apt-key adv --recv-keys --keyserver hkp:// 0xcbcb082a1bb943db
    - sudo add-apt-repository -y 'deb precise main'
    - sudo apt-get update
    - sudo apt-get purge mysql* mariadb*
    - sudo DEBIAN_FRONTEND=noninteractive aptitude install -y mariadb-server
    - sudo apt-get install libmariadbclient-dev
1 Like