Skip to content

Instantly share code, notes, and snippets.

@BenMorel
Last active December 6, 2019 06:24
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save BenMorel/d981f25ead0926a0cb6d to your computer and use it in GitHub Desktop.
Save BenMorel/d981f25ead0926a0cb6d to your computer and use it in GitHub Desktop.
Install MySQL 5.7 on Travis-CI
sudo apt-get remove --purge "^mysql.*"
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /var/lib/mysql
sudo rm -rf /var/log/mysql
echo mysql-apt-config mysql-apt-config/enable-repo select mysql-5.7-dmr | sudo debconf-set-selections
wget http://dev.mysql.com/get/mysql-apt-config_0.2.1-1ubuntu12.04_all.deb
sudo dpkg --install mysql-apt-config_0.2.1-1ubuntu12.04_all.deb
sudo apt-get update -q
sudo apt-get install -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" mysql-server
before_script:
- bash .travis.install-mysql-5.7.sh
@mx781
Copy link

mx781 commented Jan 4, 2017

I could not get @Codyzy's script to work on Trusty (14.04) either, but passing the non-interactive flag directly to dpkg worked flawlessly with the newer mysql-apt-config:

sudo DEBIAN_FRONTEND=noninteractive dpkg -i mysql-apt-config_0.8.1-1_all.deb

@alphamarket
Copy link

In .travis file you need to add sudo: required so the sudos in the script can be run.

@alphamarket
Copy link

@asimzeeshan Try to change the mysql-5.7-dmr to mysql-5.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment