Last Updated on January 30, 2023 by Vikash Ekka
In this tutorial, we will show you how to install MySQL 5.6 on Ubuntu 20.04 LTS from the Ubuntu repository manually.
MySQL is a popular open-source relational database management system used for a wide range of applications.
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.
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.
Also Read:
* How to install MySQL 5.5 on Ubuntu 20.04 LTS.
* Uninstall or Remove MySql 5.7 from Ubuntu 20.04 LTS.
Prerequisites
Before we begin, make sure that you have a fresh installation of Ubuntu 20.04 LTS and root or sudo access to the system.
You should also update your system by running the following commands:
sudo apt update
sudo apt upgrade
Install MySQL 5.6 on Ubuntu 20.0
Step 1: Add the MySQL APT repository
To install MySQL 5.6, we need to add the MySQL APT repository to our system. First, we will add the universe repository to our system. To do this, run the following command:
sudo add-apt-repository universe
Next, we will add the MySQL APT repository to our system. To do this, run the following command:
sudo echo "deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.6" | sudo tee /etc/apt/sources.list.d/mysql-5.6.list
Step 2: Download the MySQL GPG key
Next, we need to download the MySQL GPG key to ensure that we are downloading the correct packages. To do this, run the following command:
wget https://repo.mysql.com//RPM-GPG-KEY-mysql
Step 3: Add the MySQL GPG key
After downloading the GPG key, we need to add it to our system. To do this, run the following command:
sudo apt-key add RPM-GPG-KEY-mysql
Step 4: Update the package index
After adding the MySQL APT repository and the GPG key, we need to update the package index to ensure that we have access to the latest packages. To do this, run the following command:
sudo apt update
Step 5: Install MySQL 5.6
Now that the package index has been updated, we can install MySQL 5.6 by running the following command:
sudo apt install mysql-server-5.6
Step 6: Start the MySQL service
After the installation has been completed, we need to start the MySQL service. To do this, run the following command:
sudo service mysql start
Step 7: Verify the installation
To verify the installation, we can use the mysql command-line client to connect to the MySQL server and check the version. To do this, run the following command:
mysql -u root -p
After entering the password, you should see the MySQL prompt. To check the version, run the following command:
SHOW VARIABLES LIKE '%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.
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 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.