How to Upgrade From MySQL 5.7 to 8.0 on Ubuntu 18.04 AWS Cloud9



How to Upgrade From MySQL 5.7 to 8.0 on Ubuntu 18.04 AWS Cloud9

How to Upgrade From MySQL 5.7 to 8.0 on Ubuntu 18.04 AWS Cloud9

Hi, everybody, in this video, I’ll show you how to upgrade from MySQL 5.7 to MySQL 8.0 on an Ubuntu system.

MySQL APT Repository Setup Package Link: https://dev.mysql.com/downloads/repo/apt/

Timestamps:

00:00 Introduction
00:38 Download the latest MySQL APT Repository Setup Package
01:50 How to install the MySQL APT Configuration Debian package
02:07 How to configure the MySQL version to install
03:00 Run apt-get update
03:17 Upgrading to MySQL 8.0

Right now I am on an AWS Cloud9 environment running Ubuntu Server 18.04. And if I run mysql here in the command line, we see that what I have is version 5.7. Let’s go ahead and upgrade this to version 8 using the MySQL APT repository.

Now if you already have some existing data, make sure to do a backup first before doing the upgrade.

So first, let’s get the download link for the latest MySQL APT Repository Setup package by going to this page:

https://dev.mysql.com/downloads/repo/apt/

You’ll find the link in the description.

At the time of this recording, this is the latest version.

And then let’s click on the download button.

Now we won’t actually download the file just yet. We will just copy the link to it. If I hover over the “No thanks, just start my download” link, I can see the actual link here in my status bar. So let’s go ahead and copy this link.

And then back here in the command line, we can download the file to our current working directory by typing wget followed by the download link:

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

Take note of the file name of the package, yours might be different depending on when you are watching this video.

Ok so once the download is complete, we can verify that we have the file by typing ls to list the contents of our current working directory… and here it is.

Now to install this setup package, type sudo dpkg -i followed by the path to the file, which in this case is just going to be the filename since we are in the same directory as the file.

Once installed, we will automatically see this configuration prompt. We can use the up and down arrow keys to select the different options. Check which version is shown here in the MySQL Server and Cluster option. If it says version 8.0 then you don’t need to change that, but for me, I see version 5.7. So I will press enter so that I can change it.

And then here, I will select mysql-8.0 and then press enter again. And now I can see that the change has been made. As for the other settings, I will just leave them as they are, and then I will select ok and press enter.

Now at this point, we haven’t upgraded to mysql 8 yet. What we were doing previously was just some setup configuration. We still need to install the actual MySQL package. But before we do that, we should run this command first: sudo apt-get update. We need to do this to ensure that we get all the updated package information for the software that we are about to install or upgrade to.

And once the update is finished, we can now upgrade to mysql version 8 by typing sudo apt-get install mysql-server

Enter Y when asked to continue.

And then choose the authentication method, I’m just going to go with Strong Password Encryption. But you also have the option to choose the legacy method if that’s what you need. Press enter and then we wait for the setup to complete.

And now that it’s done, let’s run mysql again, and here we see that we are now using mysql version 8.

Twitter: https://twitter.com/choobtorials

#Ubuntu #MySQL8

Comments are closed.