Installing MySQL 5.7



I made a script to install MySQL 5.7 on CircleCI container. Simply run

curl -sSL | sh

How to change MySQL/MariaDB version
MySQL JSON Datatype support

Thanks for this @kimh. Where do you recommend we put this in our circle.yml file?


I think the script froze:


Sorry about that! It looks like this issue is happening because DEBIAN_FRONTEND isn’t set to noninteractive in our builds. In order to make sure that this script runs correctly you would need to change the curl command to

export DEBIAN_FRONTEND=noninteractive && curl -sSL | sh


Thanks. Still failed


That looks intermittent network issue with apt. Can you try again?


I tried it again and it worked. Thank you! It would be much nicer to put it in circle.yml such as:

    version: 5.7.12

But this does work, so much appreciated.


The script is missing the step to upgrade database/data to 5.7 using mysql_upgrade command.


Instead of the script you can use docker and the official mysql images.
Available versions:

    - docker
    # Stop the preinstalled MySQL 5.6
    - sudo service mysql stop
    # Start MySQL 5.7.11 within a docker container
    - docker info
    - >
      docker run
      --name mysql
      --publish 3306:3306
      --env MYSQL_DATABASE=circle_test
      --env MYSQL_USER=ubuntu
      --env MYSQL_PASSWORD=p455w0rd
      ; sleep 10


@kimh this started failing today for me, getting these errors:

W: Failed to fetch http :// Unable to find expected entry ‘mysql-5.7-dmr/source/Sources’ in Release file (Wrong sources.list entry or malformed file)

E: Some index files failed to download. They have been ignored, or old ones used instead.

export DEBIAN_FRONTEND=noninteractive && curl -sSL | sh returned exit code 100

Action failed: export DEBIAN_FRONTEND=noninteractive && curl -sSL | sh


I can confirm I am getting the exact same error. It just started today.


I tihnk the problem is that script is trying to add mysql-5.7-dmr instead of just mysql-5.7. Now that 5.7 is GA, dmr release is no longer there.


That was the issue. I copied the script and made the change and everything works.


Thanks for letting us know about this. We’ve now updated the script so it should work again as expected.


I forked kimh’s script and created new one.

I also wrote this on my blog.


I believe this script upgrades from the mysql already installed on Circle’s base image, so I added an apt-get remove first, to ensure a fresh install. Upgrading can have side effects (