I'm unable to install mySql 5.6 on my newly installed Ubuntu 18.04. I have tried solution from lots of links ( link1 link2 ... ) but no success at all.
I have 5.7 installed, but due to client's requirement, I need to do it anyhow. There are few changes that make it incompatible with 5.6 without making changes in code in around 5 running projects ( 7 developers involved ) which was started when I was using Ubuntu 17.10 with mysql 5.6.
UPDATE: Ahmed has suggested a manual approach which is a good solution but I wish someone knows to do it Ubuntu's apt way so that more people will be benefited.
I've tried many approaches until I was successful.
The approach that worked
The only approach that worked was downloading the deb-bundble.tar from MySQL website and installing the packages one by one. I followed these steps:
mysql-server_5.6.40-1ubuntu14.04_amd64.deb-bundle.tar
, usually, it's the first optiontar -xf mysql-server_5.6.40-1ubuntu14.04_amd64.deb-bundle.tar
deb
packages, includingmysql-server
,mysql-community-server
, ... etcsudo dpkg -i <package-name>
one-by-one, but I had follow their order according to error messages that fired, e.g.: I first tried:sudo dpkg -i mysql-server_5.6.40-1ubuntu14.04_amd64.deb
, it failed because it requiresmysql-community-server_5.6.40-1ubuntu14.04_amd64.deb
to be installed first and so on. The right order for a few is:mysql-common
,mysql-community-client
,mysql-client
and thenmysql-community-server
.sudo dpkg -i mysql-server_5.6.40-1ubuntu14.04_amd64.deb
for the last time which gave some errors, I desperately tried:sudo apt-get install -f
which grabbed the missing dependencies and voila, MySQL Server 5.6 is successfully installed, up and runningApproaches that didn't work
Using Trusty Universal Repo
It's worth mentioning that I first tried the same approach that used to work in Ubuntu 16.04, that is, to add the 'trusty universe' repo and try installing mysql-server-5.6, i.e. I followed this:
This approach did NOT work. It failed because there's a dependency
initscripts
that cannot be installed. It seems that it have been replaced after Ubuntu 16.04. Installing it's replacements:util-util-linux sysvinit-utils
didn't help either.Using MySQL apt config package
I also tried using MySQL config package (
mysql-apt-config_0.7.3-1_all.deb
) I downloaded from this repo: https://repo.mysql.com/ and installed via:sudo dpkg -i mysql-apt-config_0.7.3-1_all.deb
. It didn't recognize Ubuntu 18.04 (bionic) of course, so, I acted as if it's xenial and configured MySQL Server version to 5.6, then I tried to check which MySQL version is now available for installation using:apt-cache policy mysql-server
but that also didn't work, I still have later versions than 5.6.Final note
Although the last two approaches didn't work, they may have contributed to the success of the first approach by making some packages or configuration available, I honestly don't know.
When I became hopeless that any approach would work, I considered compiling and installing it from source, I started that endeavor (I installed the build essentials and created the user group and the user) and was about to grab the source code when I stumbled upon the deb-bundle that turned out to be fruitful and was the successful approach I described above.
Perhaps a bit offtopic, but my prefered way of solving things like this is to use docker.
you can install docker and docker-compose. Create a docker-compose.yml file, in example /home/whatever/mysql-5.6 that looks like this.
and then do docker-compose up -d
Alternativly you can just install docker-ce, and do a "dryrun" of the image whit the following command to just check it out.
Full explanation of the mysql Dockerfiles, here. https://hub.docker.com/_/mysql/
You can download & install Mysql 5.6 debian packages manually from Mysql apt repository.
MariaDB is a fully compatible drop-in replacement for MySQL, and is available in the default Ubuntu repositories. It can be installed with:
The setup should detect all existing MySQL databases and import them, but just in case, read this answer, and have a backup ready.
Notes about MariaDB
While the question is about
MySQL
, MariaDBand is compatible with all* applications that use MySQL. It listens on the same ports and all the commands are the same(i.e.
mysql
,mysqldump
, etc.).*Ok, you can probably find some really old applications that won't work with MariaDB, but the chances of that are really, really small.
I know this answer is a little bit late. but, i had to mention that current version of MySQL APT Repository (mysql-apt-config_0.8.12-1_all.deb) worked fine with me on Ubuntu 18.04.
here is how to use it.
Yes! you can install MySQL 5.5.56 following these Installation instructions.
To improve on @Ahmed Moawad's answer
You only need to install the libaio1 using apt. That is as shown below.
Then install the following list of mysql deb packages using the dpkg command in the order provided.
Once these packages are installed, mysql will be up and running ready for use. Only that during the installation of the package number 5 you will prompted for the root password.