100% found this document useful (1 vote)
3K views2 pages

Install MySQL 5.6 in Ubuntu 16.04

The document provides steps to install MySQL 5.6 in Ubuntu 16.04 by using the APT repositories from Ubuntu 15.10, which are backwards compatible. It involves removing the existing MySQL 5.7 packages, installing the MySQL APT configuration package, editing the APT sources list to point to the 15.10 repositories, giving them high priority, and then installing the MySQL 5.6 client and server packages. Any Ruby gems linked to the old MySQL libraries also need to be removed and reinstalled.

Uploaded by

darkxnight
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
3K views2 pages

Install MySQL 5.6 in Ubuntu 16.04

The document provides steps to install MySQL 5.6 in Ubuntu 16.04 by using the APT repositories from Ubuntu 15.10, which are backwards compatible. It involves removing the existing MySQL 5.7 packages, installing the MySQL APT configuration package, editing the APT sources list to point to the 15.10 repositories, giving them high priority, and then installing the MySQL 5.6 client and server packages. Any Ruby gems linked to the old MySQL libraries also need to be removed and reinstalled.

Uploaded by

darkxnight
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

9/2/2017 Install MySQL 5.6 in Ubuntu 16.

04 - makandropedia

Install MySQL 5.6 in Ubuntu 16.04


Ubuntu 16.04 only provides packages for MySQL 5.7 which has a range of backwards compatibility issues
with code written against older MySQL versions.

Oracle maintains a list of official APT repositories for MySQL 5.6, but those repositories do not yet support
Ubuntu 16.04. However, the 15.10 repos will work for 16.04.

I would not recommend to do this in production environment, but on a development machine, follow these
steps:

Dump your databases, if you want to keep them. Keeping the data directory itself did not work for me.
Uninstall everything related to MySQL 5.7 with

apt remove mysql-client mysql-server libmysqlclient-dev mysql-common

Check if you removed everything using

dpkg -l | grep mysql

Purge remainders (e.g. marked with rc) with dpkg -P <package> [<package> ...].

Download the apt_config-debian package from Oracle (https://repo.mysql.com/) and install it using

dpkg -i mysql-apt-config_0.7.2-1_all.deb

Choose "MySQL 5.6" and "Ubuntu Wily" (assuming Xenial is not yet provided)

Run

apt-cache policy mysql-server

If this shows a 5.6 version, continue.

If not, check your /etc/apt/sources.list.d/mysql.list. It should look roughly like this:

### THIS FILE IS AUTOMATICALLY CONFIGURED ###


# You may comment out entries below, but any other modifications may
be lost.
# Use command 'dpkg-reconfigure mysql-apt-config' as root for
modifications.
deb http://repo.mysql.com/apt/ubuntu/ wily mysql-apt-config
deb http://repo.mysql.com/apt/ubuntu/ wily mysql-5.6
deb http://repo.mysql.com/apt//ubuntu/ wily mysql-tools
deb-src http://repo.mysql.com/apt/ubuntu/ wily mysql-5.6

You might have to replace "xenial" with "wily". Although you are using 16.04 (codename Xenial), Oracle
currently seems to only provide 5.6 in the repos for 14.04 (codename Wiley). But those sources work for
16.04, too.

Create a file /etc/apt/preferences.d/mysql with this content

https://makandracards.com/makandra/39899-install-mysql-5-6-in-ubuntu-16-04 1/2
9/2/2017 Install MySQL 5.6 in Ubuntu 16.04 - makandropedia

Package: *
Pin: origin "repo.mysql.com"
Pin-Priority: 999

Run

apt update

Run

apt install mysql-client mysql-server libmysqlclient-dev

You should get 5.6 versions.

In case you have installed and MySQL ruby gems (like mysql2), you will have to remove and reinstall them,
since they have been linked to the old libraries. Note that gem pristine will not help.

Posted by Tobias Kraze to makandropedia

https://makandracards.com/makandra/39899-install-mysql-5-6-in-ubuntu-16-04 2/2

You might also like