Last Updated on January 30, 2023 by Vikash Ekka
In this tutorial, we will guide you through the steps to install MySQL 5.6 on Ubuntu 20.04 LTS.
MySQL is one of the most popular relational database management systems in the world. It is widely used for web applications, data warehousing, and other applications that require a high-performance and scalable database solution.
MySQL is highly scalable and flexible, and it can handle large amounts of data efficiently. It supports multiple storage engines, including InnoDB and MyISAM, which allow you to choose the right storage engine for your specific needs. It also supports data replication, which allows you to create multiple replicas of your data for backup, redundancy, and load balancing purposes.
MySQL stores data in tables, with each table consisting of rows and columns. It uses the Structured Query Language (SQL) to interact with the database and to manage data. SQL is a standard language used by most relational databases, and it provides commands for creating tables, inserting and retrieving data, updating and deleting records, and more.
Before we begin, make sure that you have a fresh installation of Ubuntu 20.04 LTS.
Also, you should have root or sudo access on your machine. You should also update your system to ensure that you have the latest packages and security updates.
To do this, run the following commands:
sudo apt update sudo apt upgrade
Install MySQL 5.6 on Ubuntu 20.04
MySQL 5.6 is no longer available in the official Ubuntu repository, so we need to download the package from Ubuntu repository. To do this, we will use the below steps to download the repository package:
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 server.
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 from below command
sudo apt-get update
Step 3: Install MySQL 5.6 server
sudo apt-get install mysql-server-5.6
Step 4: Create a
sudo touch /var/run/mysqld/mysql.sock
Step 5: Give ownership to
sudo chown mysql:mysql /var/run/mysqld
Step 6: Now stop the MySQL service
sudo /etc/init.d/mysql stop
Step 7: Stat the MySQL service
sudo /etc/init.d/mysql start
Step 8: Check status of MySQL service
sudo service mysql status
Step 9: Login to MySQL 5.6 server
mysql -u root -p
Step 10: Check MySQL Version
The output should display the version of MySQL that is installed, which should be 5.6.
If you need to use MySQL 5.6 on Ubuntu 20.04, you have a few options:
- Use a third-party repository: There are several third-party repositories that still host the MySQL 5.6 package. You can add these repositories to your system and install MySQL 5.6 from there. Keep in mind that using third-party repositories can introduce security and compatibility issues.
- Use a Docker container: If you need to run MySQL 5.6 for testing or development purposes, you can use a Docker container. You can find official MySQL images for different versions, including 5.6, on the Docker Hub.
- Install MySQL 5.6 on a virtual machine: You can install a virtual machine on your system and install Ubuntu 16.04, which supports MySQL 5.6. This way, you can run Ubuntu 16.04 and MySQL 5.6 alongside your main operating system.
Please keep in mind that installing an older version of MySQL, especially one that is not supported by the official repository, may introduce security and compatibility issues. If possible, it is recommended to upgrade to a newer version of MySQL.
In this tutorial, we have shown you how to install MySQL 5.6 on Ubuntu 20.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.
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.