Skip to content

Instantly share code, notes, and snippets.

@mahemoff
Created April 13, 2015 14:49
Show Gist options
  • Save mahemoff/54b31e272421472d4fb6 to your computer and use it in GitHub Desktop.
Save mahemoff/54b31e272421472d4fb6 to your computer and use it in GitHub Desktop.
MySQL 5.6 in CircleCI
dependencies:
post:
- export DEBIAN_FRONTEND=noninteractive
- sudo apt-get -y remove mysql-server
- sudo apt-get -y autoremove
- sudo apt-get -y install software-properties-common
- sudo add-apt-repository -y ppa:ondrej/mysql-5.6
- sudo apt-get update
- sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password ""'
- sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password ""'
- sudo apt-get -y install mysql-server
@jfeldstein
Copy link

I've asked their support. They don't have a way.

@eexit
Copy link

eexit commented Feb 9, 2017

Hi there,

The code above didn't work because apt would get a bunch of 404 errors.
This worked for me:

machine:
  pre:
    # Install MySQL 5.6 (5.5 is installed by default)
    - >
      export DEBIAN_FRONTEND=noninteractive
      && sudo apt-get update -y; true
      && sudo apt-get -y remove mysql-server
      && sudo apt-get -y autoremove
      && sudo apt-get -y install software-properties-common
      && sudo apt-add-repository -y 'deb http://ppa.launchpad.net/ondrej/mysql-experimental/ubuntu precise main'
      && sudo apt-get update -y; true
      && sudo apt-get -y install mysql-server
      && sudo chown -R mysql:mysql /var/lib/mysql

@ccopto
Copy link

ccopto commented Jun 12, 2017

Hi all,

I took the code from @eexit and change a couple of lines because it wasn't working on my builds, here is my successful attempt, hope it helps.

machine:
    pre:
    - sudo apt-get update -y; true
    - sudo apt-get -y remove mysql-server
    - sudo apt-get -y install software-properties-common
    - sudo apt-add-repository -y 'deb http://ppa.launchpad.net/ondrej/mysql-experimental/ubuntu precise main'
    - sudo apt-get update -y; true
    - export DEBIAN_FRONTEND=noninteractive && sudo -E apt-get -y install mysql-server
    - sudo chown -R mysql:mysql /var/lib/mysql

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