How to install MySQL 5.5 on Ubuntu 20.04 LTS | vetechno

How to install MySQL 5.5 on Ubuntu 20.04 LTS
How to install MySQL 5.5 on Ubuntu 20.04 LTS


MySQL is an open-source database management system and free to use. It is commonly installed as part of the most popular LAMP (Linux, Apache, MySQL, PHP/Python/Perl) stack and LEMP (Linux, Nginx, MySQL, PHP) stack.

It uses a relational database and SQL (Structured Query Language) to manage its data. It is the most common software stack that comes up with dynamic websites and web applications.

This tutorial will help to install MySQL 5.5 in ubuntu 20.04 LTS. In this tutorial what we are doing is that we are just installing MySQL 5.5 manually on Ubuntu desktop or server because ubuntu has removed its APT repository for MySQL 5.5. and MySQL 5.6. And the same with the Personal Package Archives (PPAs) software repositories. So first we have to download the MySQL package from the official website.

I have tested on ubuntu 16.04, ubuntu 18.04 LTS, and ubuntu 20.04 LTS.

With the same steps below mentioned you can also install MySQL 5.6 and MySQL 5.7 only you have to do download the required MySQL packages from the official website .

Let's begin with our installation.

Read:-  How to install Mysql 5.6 on Ubuntu 18.04 LTS

Read:-  Remove MySql from Ubuntu 18.04 LTS


* Need root user access.
* Internet 
* MySQL 5.5 packages.
* Ubuntu 20.04/18.04 LTS 

Mysql 5.5 Download Link.


Open Terminal by pressing Crtl + Alt + t and follow the below steps:-

Step1. If you have installed another MySQL then uninstall it.

sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean

sudo rm -rf /var/lib/mysql
sudo rm -rf /etc/mysql
sudo apt-get autoremove
sudo apt-get autoclean

Delete the MySQL profile (Optional).

sudo rm /etc/mysql/ -R

Step3. Download Mysql 5.5 tar.gz file from the terminal.

wget https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz

Step4. Extract the MySQL 5.5 tar.gz file .

sudo tar -xvf mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz

Now we have to add a MySQL user group.

sudo groupadd mysql

Step6. Add MySQL (not the current user) to the MySQL user group.

sudo useradd -g mysql mysql

Move it to /usr/local

sudo mv mysql-5.5.56-linux-glibc2.5-x86_64 /usr/local/

Step8. Rename  the file to mysql.

cd /usr/local

sudo mv mysql-5.5.56-linux-glibc2.5-x86_64 mysql

Step9. Now set Mysql directory ownership and user group .

cd mysql
sudo chown -R mysql:mysql *

Step10. Install the required lib packages (also work with Mysql 5.6).

sudo apt-get install libaio1

Execute mysql installation script.

sudo scripts/mysql_install_db --user=mysql

Step12. Set mysql directory ownership from outside the mysql directory.

sudo chown -R root .

Step13. Set data directory ownership from inside mysql directory.

sudo chown -R mysql data

Then we have to copy the mysql configuration file.

sudo cp support-files/my-medium.cnf /etc/my.cnf

Step15. Start mysql Services.

sudo bin/mysqld_safe --user=mysql &
sudo cp support-files/mysql.server /etc/init.d/mysql.server

Step16. Set root user password.

sudo bin/mysqladmin -u root password '[Enter your new password]'

Add mysql path to the system.

sudo ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql

Step18. Rebooot your server.

Step19. Start mysql server service .

sudo /etc/init.d/mysql.server start

Step20. Stop
mysql server service .

sudo /etc/init.d/mysql.server stop

Step21. Now check status of mysql

sudo /etc/init.d/mysql.server status

Enable myql on startup

sudo update-rc.d -f mysql.server defaults

Step23.  Disable mysql on startup (Optional)

sudo update-rc.d -f mysql.server remove

Step24. Now you are ready to login mysql server follow below command.

mysql -u root -p


We have successfully install MySQL 5.5 on ubuntu 20.04 LTS and Ubuntu 18.04 LTS operating system. Let me know in the comment box if you are facing any kind of issue. We will happy to answer those question.

Read:-  How to install Mysql 5.6 on Ubuntu 18.04 LTS

Read:-  Remove MySql from Ubuntu 18.04 LTS

Read:-  How To Install PHP Composer on Ubuntu 20.04 LTS

Read:-  How to Install MySQL 8.0 on Ubuntu 20.04 LTS.

Post a Comment