- Ubuntu 16.4 allows only MySQL v5.7.13 (as of now) which has a memory leak bug
- According to release notes this bug was fixed with v5.7.14
- The idea here is to install MySQL v5.6 that was built for Ubuntu 15.10 (wily)
- Remove previous MySQL versions if any
sudo apt remove mysql-client mysql-server libmysqlclient-dev mysql-common
- Check if anything left installed and remove if any
dpkg -l | grep mysql
- Download and install apt_config-debian package ~20 kb
# Installing an old version instead
wget --retry-connrefused --tries=0 http://repo.mysql.com/mysql-apt-config_0.7.2-1_all.deb
sudo dkpg -i mysql-apt-config_0.7.2-1_all.deb
- This screen is a bit tricky (repeat if you failed) - Choose Ubuntu Wily and MySQL 5.6 when asked.
- Check if MySQL 5.6 is in the apt index list
sudo apt-cache policy mysql-server | grep 5.6
- 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
withwily
- Create a new file
/etc/apt/preferences.d/mysql
with this content
Package: *
Pin: origin "repo.mysql.com"
Pin-Priority: 999
- Above file will prevent apt from picking up mysql from Ubuntu servers
- Update apt indexes
sudo apt update
- Install MySQL 5.6 (no need to speficy version)
sudo apt install mysql-client mysql-server
- Answer the asked questions, remember your root password
- Check mysql version
mysql --version
- Enjoy
MariaDB enables a plugin called unix_socket for the root user by default, this plugin prevents that the root user can log in to PHPMyAdmin and that TCP connections to MySQL are working for the root user. Therefore, lets deactivate that plugin with the following commands:
sudo mysql -u root
use mysql;
update user set plugin='' where User='root';
flush privileges;
quit;
sudo service mysql restart
# Now you can set password for root if you want
mysql_secure_installation