Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
@BenMorel

This comment has been minimized.

Copy link
Owner Author

commented Sep 28, 2014

Note: this currently removes hhvm, which likely has dependencies on a mysql* package. I did not yet find a way to make this work without fully uninstalling MySQL 5.5 first.

@philippecarle

This comment has been minimized.

Copy link

commented Jan 16, 2016

I can't connect to mysql using your method : Access denied for user 'root'@'localhost'.
Do you have an idea ?

@centralepharma

This comment has been minimized.

Copy link

commented Feb 11, 2016

Here is my way of improving this method and making it work for my project : http://stackoverflow.com/questions/34831695/configure-mysql-5-7-with-travis-ci

@mr-feek

This comment has been minimized.

Copy link

commented Apr 26, 2016

+1 `Access denied for user 'root'@'localhost'

@javiergloria

This comment has been minimized.

Copy link

commented Jun 22, 2016

+1 `Access denied for user 'root'@'localhost'

@gcphost

This comment has been minimized.

Copy link

commented Aug 9, 2016

As of today it's just select mysql-5.7 not select mysql-5.7-dmr.

As for access denied it seems 5.7 uses a temporary root password:
https://www.percona.com/blog/2016/05/18/where-is-the-mysql-5-7-root-password/

I did not have a password issue with the dmr build but I do with the latest.

@codyzu

This comment has been minimized.

Copy link

commented Aug 12, 2016

As mentioned by @gcphost this is broken because mysql-5.7-dmr no longer exists. Here is my modified and working install script for travis that installs the official 5.7.

@BenMorel

This comment has been minimized.

Copy link
Owner Author

commented Dec 10, 2016

Sorry for not reacting to your comments, they still don't trigger notifications to date.
@codyzu's install script is the way to go right now!

@asimzeeshan

This comment has been minimized.

Copy link

commented Dec 29, 2016

@codyzu can you verify? I cannot seems to get it to work on xenial (Ubuntu 16.06)

@mx781

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Mar 22, 2017

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

@alphamarket

This comment has been minimized.

Copy link

commented Mar 22, 2017

@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
You can’t perform that action at this time.