Last Updated on February 11, 2023 by Vikash Ekka
MySQL is one of the most popular open-source RDMS (relational database management system) which is easy to use, fast, scalable, and an integral part of the popular LEMP and LAMP stacks.
In this tutorial, we will show you how to install and secure MySQL 5.6 on an Ubuntu 18.04 LTS Operating System. This same method has been tested on Ubuntu 20.04 server as well.
Also Read – Install mysql 5.6 on Ubuntu 20.04
Prerequisites
Make sure you are logged in as a user with sudo privileges .
How install MySQL 5.6 in Ubuntu 18.04 using terminal
Step 1. First of all you have to add a repository in /etc/apt/sources.list
Below are the step by step commands that you have to follow for installing MySql 5.6
sudo add-apt-repository ‘deb http://kr.archive.ubuntu.com/ubuntu xenial main’
Note:– if above repository is not working then use below the repo
sudo add-apt-repository ‘deb http://archive.ubuntu.com/ubuntu trusty universe’
Step 2. Now update the repository
sudo apt-get update
Step 3. Install Mysql 5.6 on Ubuntu
sudo apt-get install mysql-server-5.6
Step 4. Create a mysql.sock
file
sudo touch /var/run/mysqld/mysql.sock
Step 5. Give ownership to mysqld
file
sudo chown mysql:mysql /var/run/mysqld
Step 6. Now Stop mysql service with below command
sudo /etc/init.d/mysql stop
Step 7. Stat mysql service
sudo /etc/init.d/mysql start
Step 8. Check status of mysql service
sudo service mysql status
You have successfully install the mysql 5.6 server, now its time to login and verify the status
Step 9. Login to mysql 5.6 server
mysql -u root -p
Also Read:
* How to install MySQL 5.5 on Ubuntu 20.04 LTS.
* Uninstall or Remove MySql 5.7 from Ubuntu 20.04 LTS.
Conclusion
In this tutorial, we have shown you how to install MySQL 5.6 on Ubuntu 18.04 LTS. MySQL 5.6 is a reliable and high-performance database management system that is widely used for web applications and data warehousing.
By following the steps in this tutorial, you can easily install MySQL 5.6 on your Ubuntu 20.04 LTS system as well.
Let us know if you are facing any issue while installing in the below comment box. We will happy to assist you. Please feel free to contact us.
thanks