MySql 8.0 LTS to 8.4 LTS
This blog requires multiple software components and one of them is MySql which I have been upgrading over time of the original install of MySql 5 and now it is on 8.0. This transition has not been easy or straightforward because of the change to utfmb4 was a huge pain and required reworking tables and reloading them. This is detailed here.
Now again I am at the crossroads of needing to do an upgrade as 8.0 is losing Long Term Support LTS on May 1 2026. Therefore I need to move to MySql 8.4 LTS which will be supported for at least 3 more years (I will upgrade to 9.7 before then).
Step 1
First make a backup. Backup your entire database or virtual machine.
You may need to revert as in my case in the upgrade process completed successfully, but none of my connected applications worked anymore after the upgrade. Why is that? User passwords for connecting to the database were originally stored in the format of mysql_native_password and this is deprecated and no longer works in 8.4 and higher.
I checked this by using my sudo rights to login to MySql like so sudo mysql -u root , you may also try sudo su -c "mysql" to gain access to the root user account. After you are connected. Run the following sql query SELECT user, host, plugin from mysql.user
In my case I was presented with these results
+------------------+-----------+-----------------------+
| user | host | plugin |
+------------------+-----------+-----------------------+
| debian-sys-maint | localhost | mysql_native_password |
| ghost | localhost | mysql_native_password |
| mysql.infoschema | localhost | mysql_native_password |
| mysql.session | localhost | mysql_native_password |
| mysql.sys | localhost | mysql_native_password |
| root | localhost | auth_socket |
+------------------+-----------+-----------------------+
From the above every account will need to be switched to the new plugin format compatible with 8.4 + which is caching_sha2_password. In the above I only need to change 2 user accounts ghost, debian-sys-maint because the mysql.* managed accounts will automatically get upgraded and the root account should stay as is.
Make sure you either know the current password or are going to update all your applications with the new password then run the following sql statement per each applicable account. Example is for the ghost account ALTER USER 'ghost'@'localhost' IDENTIFIED WITH caching_sha2_password BY '<PASSWORD>';
Restart mysql to make sure all changes are ready and working with your current setup, sudo service mysql restart
Step 2
I recommend using the MySql apt repository link here. Use the following commands
wget https://dev.mysql.com/downloads/mysql-apt-config_08.36-1_all.debThen install the apt repository
sudo dpkg -i mysql-apt-config_08.36-1_all.debRun the revised commands one by one, you may not need to run the force installation command like I did at the end
sudo apt-get update
sudo apt cache policy mysql-server
sudo apt upgrade
sudo apt install mysql-serverOnce the install starts you will be prompted as needed and may need to enter your configuration information. Here is a good guide over expected screens.
Step 3
After installation verify your version
mysql --version
If you do not see this version you may need to restart the mysql server service sudo service mysql restart
If it is successful you should see the following
mysql Ver 8.4.7 for Linux on x86_64 (MySQL Community Server - GPL)Now verify all your connected applications are still functioning. If you changed your password because you didn't remember it in Step 1 you will need to update the application connections.