Install mysql server 5.7 on travis
New version : using Docker (see below for previous version)
With previous version we had to adapt the script to changes done in the travis worker image. To avoid this we will use docker to start any mysql server with the right config and we’ll stop the default mysql server started if any.
- sudo service mysql stop || sudo service mysql-5.6 stop || sudo stop mysql-5.6 || sudo stop mysql || echo "failed to stop mysql"
- sudo docker run -d -p 3306:3306 mysql:5.7 # or whatever version mysql:5.6 mysql:5.5 mysql:5.8 or your custom mysql image
Legacy version (could not work anymore)
There are two scripts, first install mysql 5.7 from mysql apt repo:
Then reset password for root mysql user to empty so you can connect easily:
Include these two scripts in your travis yml file: