Upgrading MySQL 5.5 to 5.7 in Debian

Last Updated: October 29, 2018 | Reading Time: < 1 minute

I know, MySQL 5.5 is quite old, let’s get an upgrade then.

First of all, let’s backup the databases:

mysqldump --all-databases > all_databases.sql

Download the latest APT package repository

wget https://dev.mysql.com/get/mysql-apt-config_0.8.10-1_all.deb

Make sure you download the latest version of the package. Then instal it using dpkg:

sudo dpkg -i mysql-apt-config_0.8.10-1_all.deb

you will be prompted with a dialog box, asking which version to install. If MySQL 5.7 isn’t there, press enter then select the version 5.7 from the list, select OK.

Then run the package update:

sudo apt-get update

you will see the MySQL package is on the list:

Get:5 http://repo.mysql.com jessie/mysql-5.7 Sources [886 B]

Next step is to install the MySQL:

sudo apt-get install mysql-server

This is the most important step you can’t miss, upgrade the existing databases:

sudo mysql_upgrade -u root -p

Final step, restart the database:

sudo /etc/init.d/mysql restart

Done!

Leave a Comment

Comments

No comments yet. Why don’t you start the discussion?

    Any idea? Fill the comment below

    This site uses Akismet to reduce spam. Learn how your comment data is processed.