Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I update MySQL 5.7 to the new MySQL 8.0?

How do I update to MySQL 8.0 from the default version (5.7)?

It's important for me for it to make an update and not re-install MySQL so all my data won't be corrupt.

There is not a lot of info regarding this issue since it was only released not long ago with tons of awesome new features!

This is what I have found that seems like it will only update and not destroy my data. I'm not going to proceed until I'm sure.

like image 909
Imnotapotato Avatar asked Apr 22 '18 08:04

Imnotapotato


People also ask

What is the difference between MySQL 5.7 and MySQL 8?

MySQL 8.0 implements data-at-rest encryption of UNDO and REDO logs. In 5.7 we introduced Tablespace Encryption for InnoDB tables stored in file-per-table tablespaces. This feature provides at-rest encryption for physical tablespace data files. In 8.0 we extend this to include UNDO and REDO logs.

Is MySQL 5.7 still supported?

MySQL 5.7 – Community end of life planned until October, 2023. Amazon RDS for MySQL will continue to support until the community EOL date. MySQL 8.0 – Community end of life planned until April, 2026.

What is in place upgrade in MySQL?

An in-place upgrade involves shutting down the old MySQL server, replacing the old MySQL binaries or packages with the new ones, restarting MySQL on the existing data directory, and upgrading any remaining parts of the existing installation that require upgrading.


2 Answers

You can find answer in mysql doc. It has full details about how to upgrade. Make sure to back up data before upgrading.

There are tons of ways to upgrade in the docs. The way i choose is to use APT Repository.

You should do the following things:

First, add the MySQL APT repository to your system's software repository list. The details in docs are a little abstract , i'll give a example:

wget https://repo.mysql.com/mysql-apt-config_0.8.16-1_all.deb sudo dpkg -i mysql-apt-config_0.8.16-1_all.deb 

Then you'll get this:

enter image description here

press Enter when you choose mysql server ,then select mysql 8.0.Finally choose like this:

enter image description here

Once the repo has been added, update apt index and install mysql-server:

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

Now if you don't get any error messages, you have already upgraded successfully. You can confirm by:

apt policy mysql-server 

You will get output like this:

$ apt policy mysql-server   mysql-server:       Installed: 8.0.13-1ubuntu18.04       Candidate: 8.0.13-1ubuntu18.04 
like image 153
请叫我小马哥 Avatar answered Sep 24 '22 07:09

请叫我小马哥


Use Mysql manual https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/#apt-repo-fresh-install

The sequence there is about the same, but it seems that the link to the settings file is changing. I use https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb

like image 45
F00x Avatar answered Sep 23 '22 07:09

F00x