I am trying to upgrade my mysql-server from 5.7 to 8.
I have tried many guides, and and follow the instruction, but at end I get the message :
mysql-server is already the newest version (5.7.42-0ubuntu0.18.04.1).
I did before it
sudo apt update sudo apt install mysql-server sudo apt-get install mysql-server
Nothing help.
How can I solve it please. Thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Hey @yimprogramming,
MySQL 8 is not supported by default on Ubuntu 18.04, meaning it’s not available in the official Ubuntu package repositories.
However, you can install MySQL 8 on Ubuntu 18.04 by adding Oracle’s MySQL repository or by manually downloading and installing the appropriate DEB package from the MySQL official website.
Additionally, having Ubuntu 18.04 is a major security risk as the system has been EOL for quite some time.
First and most important would be to upgrade your Ubuntu server. As you are using Ubuntu 18.04, which is heavily outdated you are using outdated OS, packages, and other tools which can cause worse performance for your application/website, not to mention vulnerability issues.
Upgrade Ubuntu or go for a new Droplet
There are two ways to go about this, either upgrade your Droplet from 18.04 to 22.04 OR create a new 22.04 Droplet and migrate your WordPress over to it.
Upgrade Ubuntu
To upgrade Ubuntu you’ll basically need to run 3 commands.
If you want to be a bit more though you can do something like:
but usually, the first 3 commands would do the trick.
Now, before you begin, I’ll recommend to create a Snapshot of your Droplet just to be sure you have everything backed in case of an emergency.
You can see the docs here:
https://docs.digitalocean.com/products/images/snapshots/
Snapshots are on-demand disk images of DigitalOcean Droplets and volumes saved to your account. Use them to create new Droplets and volumes with the same contents.
** IF you want to continue with the upgrade without upgrading your Droplet, something I do not recommend, you can check the bellow**
Upgrade only MySQL
Before starting, remember to backup your databases:
You may need to enter your MySQL root password to complete the dump.
Here’s a general guide on how you could upgrade from MySQL 5.7 to MySQL 8.0 on Ubuntu 18.04. Always consult up-to-date resources for the most accurate information.
During the installation, a prompt will ask you which MySQL product you want to configure. Choose “MySQL Server & Cluster”, then select the version “mysql-8.0”. If you don’t see “mysql-8.0” in the options, choose “ok” and then choose “Apply” on the next screen. If the MySQL version is correct, select “ok” then “Apply”.