How to upgrade MySQL 5.5 to 5.7 on Ubuntu

 

1. Run the following commands to install the MySQL server and download the necessary repository

 

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

$ sudo gdebi mysql-apt-config_0.8.10-1_all.deb

$ sudo apt-get update

$ sudo apt-get install mysql-server

 

2. The second command will ask for input

Upgrade_MySQL_5.5_to_5.7.jpg

3. Choose 5.7 and select “OK”

4. Run the following command to check and confirm the new version

 

$ mysql --version

mysql  Ver 14.14 Distrib 5.7.8-rc, for Linux (x86_64) using  EditLine wrapper

 

 

5. Don' forget to run mysql_upgrade after installation to upgrade system tables and restart server, following MySQL Upgrading guide.

$ mysql_upgrade

or

$ sudo mysql_upgrade -u root -p

6. Restart mysql

$ sudo service mysql restart