Upgrade MySQL from 5.6 to 5.7 Linux Ubuntu.

We will Upgrade MySQL Server from 5.6 to 5.7 in Ubuntu, Linux by using the command line in a few steps.

The MySQL upgrade server is for the performance and security improvements.

So before upgrading the MySQL servers from 5.6 to 5.7 take the backup of databases and the configuration files.

To take the backup use the “mysqldump” command and backup all the databases with the Master user of the databases.

$ mysqldump --lock-all-tables --all-databases -uroot -proot > all_databases.sql

Also, you can check the version of the database by login into the MySQL database.

$ mysql -uroot -proot

So After login into the server, we can see the MySQL version there are many other options to look at the versions of MySQL like (@@version in Workbench).

Now let’s see step by step to MySQL Upgrade from 5.6 to 5.7 in Ubuntu.

Find the cheat sheet and after Upgrade please come and read the whole post for better knowledge.

Cheat Sheet to MySQL Upgrade from 5.6 to 5.7 in Ubuntu

1. Stop the MySQL server.

$ sudo systemctl stop mysql

2. Download the Package and Install the Package.

$ wget http://dev.mysql.com/get/mysql-apt-config_0.8.0-1_all.deb
$ sudo dpkg -i mysql-apt-config_0.8.0-1_all.deb
$ sudo apt-get update
$ sudo apt-get install mysql-server

3. Check the Version of MySQL Server which is running after Upgrade.

$ mysql version
$ mysql -uroot -proot

STEP 1: Stop the MySQL server 5.6

So, before upgrading, we will stop the MySQL server 5.6 in Ubuntu by using the “systemctl command”.

$ sudo systemctl stop mysql

STEP 2: Download the Package and Upgrade the Package of MySQL 5.7

So when the server gets stopped we will download the package by using the “wget command”.

$ wget http://dev.mysql.com/get/mysql-apt-config_0.8.0-1_all.deb

We have downloaded the package, if you want to download the package of any other version can visit the official website of MySQL.

Now let’s install the package with the dpkg command from the command line terminal.

$ sudo dpkg -i mysql-apt-config_0.8.0-1_all.deb

So, After installing the “mysql-apt-config” it will ask for the configuration for MySQL.

“First select your current version mysql 5.6”

“Select the version MySQL 5.7”

“Click OK and use the command apt update to update the repo”

$ sudo apt-get update
$ sudo apt-get install mysql-server

Then we will install the MySQL 5.7 version and upgrade the same

Upgrade MySQL from 5.6 to 5.7
Upgrade MySQL from 5.6 to 5.7

“So now we have upgraded the MySQL 5.6 to 5.7”

$ mysql --version

Now we will check the version of MySQL, and we found that we have successfully upgraded the mysql version 5.6 to 5.7

$ mysql -uroot -proot
Upgrade MySQL from 5.6 to 5.7

So here we have successfully upgraded the MySQL server version from 5.6 to 5.7 .

Learn more about how to install MySQL 8 in CentOS and Ubuntu, how to upgrade MySQL 5.5 to 5.7, how to upgrade MySQL 5.7 to 8 on Ubuntu, Upgrade MySQL 5.6 to 5.7 linux Centos.

Give your valuable time