I have the need to install mysql 5.6 on a 16.04 machine because the provided 5.7 is not compatible with the application I'm deploying.

I followed this approach that seemed to be working, until I had to set some variables in the my.cnf file. I noticed the whole [mysqld] section was missing, and creating one was of no help.

So, further investigating,

dpkg -l | grep mysql

showed that I had most mysql packages version 5.6 except mysql-common, which came from the main xenial repo so it was 5.7, and installing mysql-common-5.6 would raise a conflict between the two and would not allow me to install it.

Since the description of the package is

MySQL database common files, e.g. /etc/mysql/my.cnf

I can imagine it's the reason why I'm having issues with my.cnf and related files. Any idea how I could force mysql-common-5.6 to be installed instead of mysql-common?

Thanks in advance

1 Answer 1


As I found trying multiple roads, I answered my own question, but since it took a while, i figured it would be better to answer it instead of deleting the question.

First off, remove all mysql packages and files (backup the important ones):

apt purge mysql*
apt autoremove
apt autoclean
rm -rf /etc/mysql/

You should now be clean.

Now go here and download the version you need, it contains all the dependencies except libaio1, so:

apt install libaio1
tar -xvf downloadedMysqlPackage.tar
dpkg -i mysql-common-xxx.deb
dpkg-preconfigure mysql-community-server-xxx.deb
dpkg -i mysql-community-server-xxx.deb
dpkg -i mysql-community-client-xxx.deb
dpkg -i libmysqlclient18-xxx.deb

And you're good to go!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.