JavaScript is required to view this page.
How-To: Install Older Version of MySQL on Debian-Based Systems

How-To: Install Older Version of MySQL on Debian-Based Systems

By Bo Lechnowsky, CEO of

MySQL is a very popular database used on servers, as well as single board computers, like the ODROID-H2+ and ODROID-HC4, for a variety of reasons. We use MySQL here at to run our back-end office database systems, presently on the ODROID-H2+ and ODROID-HC1.

Generally, it is difficult to find information on how to install an older version of MySQL. Sometimes, an older version of MySQL is required for compatibility with other software.

As of the writing of this article (October 2020), the following steps worked to install MySQL 5.5.62 on Linux Mint x86/x64:

cd /usr/local The location where MySQL should be installed
wget If this returns an error, it is because this file has been moved or removed from MySQL's site (use a web browser to find the archived files on the MySQL site and copy the link to the version you want)
groupadd mysql If this returns an error, this step wasn't needed
useradd -g mysql mysql If this returns an error, this step wasn't needed
tar -xvf mysql*.tar.gz Extracts MySQL into the current directory
rm mysql-*.gz Removes the compressed file that is no longer needed
mv mysql-* mysql Renames the long MySQL directory name to the short version
chown root:root mysql Changes the permissions on the mysql directory to the correct permissions
cd mysql Goes into the mysql directory
chown -R mysql:mysql * Changes permissions on all the files in the mysql directory to the mysql user and the mysql group
apt install libaio1 May already be installed, but just to make sure
scripts/mysql_install_db --user=mysql Installs MySQL
chown -R root . Changes permissions on the files in the MySQL directory
chown -R mysql data Changes permissions on the MySQL data directory
cp support-files/my-medium.cnf /etc/my.cnf Copies the configuration file to the correct location
bin/mysqld_safe --user=mysql & cp support-files/mysql.server /etc/init.d/mysql.server Starts MySQL server and copies the autostart file to the correct location
bin/mysqladmin -u root password 'pswd' Change 'pswd' to the MySQL root password - This will be referred to as the MySQL root password from now on
/etc/init.d/mysql.server start Starts MySQL server
/etc/init.d/mysql.server stop Stops MySQL server
update-rc.d -f mysql.server defaults Enables MySQL to start when computer is rebooted
ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql Adds MySQL to the system path
apt install libncursesw5 Installs a library needed by MySQL

At this point, after a reboot, the desired version of MySQL should automatically be running. A new database can be created, or a mysqldump backup file can be restored to this MySQL instance.

Previous article Step-by-Step Guide: Installing Home Assistant on the ODROID-M1


Robert - January 4, 2023

Great. Thanks.

for me also ‘apt install libncurses5’ was needed (ubuntu server 20.04)

Javier - September 2, 2021

Muchas gracias, me has salvado, llevo bastante tiempo buscando la forma de instalar una version vieja de mysql con el fin de realizar pruebas especificas sobre esa version.

Gene Malkin - November 4, 2020

Thank you for this. I gave up googling and instead decided to go window shopping. Landed on your frontpage and bam there was a guide to solve my mysql problem.

Also I applaud your choice of tables. Brave :)

Leave a comment

Comments must be approved before appearing

* Required fields