install mysql 5.6 ubuntu, install MySQL server 5.5 on Ubuntu, mysql 5.6,
5/5 - (5 votes)

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.

Also Read:

How to install MySQL 5.5 on Ubuntu 20.04 LTS.
Uninstall or Remove MySql 5.7 from Ubuntu 20.04 LTS.


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 xenial main’

Note:– if above repository is not working then use below the repo 

sudo add-apt-repository ‘deb 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 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 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

mysql --version


mysql -V

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:

  1. 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.
  2. 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.
  3. 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.


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.

By Vikash Ekka

Hi All, My name is Vikash Ekka from India. I’m the founder and tech editor of I have completed my Graduation in BCA. I love to write technical articles like Windows, Linux & MAC Tutorials, Tips, Tricks, How To fix, Tutorials About Ethical Hacking & Cyber Security Guide, and Software Review. Currently, I have been working as an IT professional since 2018.

4 thoughts on “How to Install MySQL 5.6 on Ubuntu 20.04 LTS | vetechno”
  1. Successfully installed but one thing I can’t modify. my.cnf
    i added lines on every my.cnf i found
    innodb_buffer_pool_size = 6G

    but checking SHOW variables like ‘innodb_buffer_pool%’; it is still on its default value. no changes has ben made.

  2. SET GLOBAL innodb_buffer_pool_size = 2097152000, SESSION innodb_buffer_pool_size = 2097152000;
    executing this command doesn’t work also. it says Innodb read only.

  3. Hello,

    Thanks very much for this tutorial, I’m very new to Ubuntu and all went very well.

    I have a question:

    How do I make sure mysql, php-mysql and the apache dependencies wont upgrade if performing unattended upgrades ??

    At this time I can’t duplicate the server for testing purposes. Do you have any ready to use routine ?

    Thanks a lot

Leave a Reply

Your email address will not be published. Required fields are marked *