How to Upgrade MySQL Community to MySQL Enterprise on Red Hat 9

Been a while since I made a post, so let’s jump straight back in with something I did recently for a customer. They had MySQL community edition but wanted to test some features that were only available in the commercial edition. So we had to upgrade MySQL community to MySQL enterprise.

Introduction

The customer was also running RHEL 9, which made things a little big more difficult since they had a fairly custom and locked down setup. For one, the server had NO access to the open internet.

This meant they had to download the rpm packages from MySQL and load them onto the server for me.

Before we start, I’ve also written this on Medium!

Upgrade MySQL Community to MySQL Enterprise

As with most things, you want to prep as much as possible before starting. This includes running MySQL backups, making a copy of the MySQL config file, and also checking data locations before beginning. I’ll cover these below:

Run a MySQL Backup

sudo mysqldump -u root -p --all-databases --single-transaction --routines --triggers --events > /tmp/mysql_backup.sql

Make sure to update the path at the end, or the — parameters if these differ to your setup.

Copy the MySQL Config

My MySQL config lived here: /etc/my.cnf, but it would also live in a number of different places. Confirm this for your environment and run something like this:

sudo cp -p /etc/my.cnf /home/USER/my.cnf.backup

Check and Stop MySQL

We now want to make sure that MySQL is currently happy, and stop the MySQL service so that we can make the upgrade possible:

sudo systemctl status mysqld  #Confirm it's healthy
sudo systemctl stop mysqld
sudo systemctl status mysqld  #Confirm it's stopped

Install the RPMs

Navigate to where ever your MySQL Enterprise RPMs are. For me, this was in /home/USER/mysql/enterprise. We then want to install the RPMs in a specific order:

sudo rpm -Uvh \
  mysql-commercial-common-8.4.6-1.1.el9.x86_64.rpm \
  mysql-commercial-client-plugins-8.4.6-1.1.el9.x86_64.rpm \
  mysql-commercial-libs-8.4.6-1.1.el9.x86_64.rpm \
  mysql-commercial-libs-compat-8.4.6-1.1.el9.x86_64.rpm \
  mysql-commercial-client-8.4.6-1.1.el9.x86_64.rpm \
  mysql-commercial-icu-data-files-8.4.6-1.1.el9.x86_64.rpm \
  mysql-commercial-server-8.4.6-1.1.el9.x86_64.rpm \
  mysql-commercial-devel-8.4.6-1.1.el9.x86_64.rpm \
  mysql-commercial-test-8.4.6-1.1.el9.x86_64.rpm \
  mysql-commercial-server-debug-8.4.6-1.1.el9.x86_64.rpm

Reload and Restart

We now want to reload the daemon for systemd:

sudo systemctl daemon-reload

And now we can start MySQL up and confirm it’s healthy:

sudo systemctl start mysqld
sudo systemctl status mysqld #Confirm it's healthy

Check MySQL Versions

You can check MySQL is now running with a commercial license a number of different ways. I’ll leave these below:

#Check version - should now say "MySQL Commercial Server"
sudo mysql --version

#Connect and verify
sudo mysql -u root -p
SELECT VERSION();
SHOW VARIABLES LIKE 'datadir';
SHOW DATABASES;

#Verify all packages are now commercial
sudo yum list installed | grep -i mysql
Upgrade MySQL Community to MySQL Enterprise

Install Cleanup

Now that MySQL commercial has been installed and replaced the community version, you can go back and remove the RPM files and maybe clean up the my.cnf.backup file you took at the beginning.

This step is entirely up to you, you might want to make sure the server is running properly by doing a full test with other users/software.

Conclusion

I was expecting this to be much harder, especially for a system with no internet access. Thankfully, MySQL has thought about this upgrade path, so they have made it much easier to upgrade from MySQL community to MySQL enterprise.

There are other guides available too if you’re running a different distro of Linux. Ubuntu and CentOS have different repository systems and commands but overall are very similar. It’s more about being aware that certain commands and processes are slightly different.

This would also be easier if you have access to the internet on your system. My customer has a very strict “NO INTERNET ACCESS TO SERVERS” policy, so I had to rely on their IT team to download the required RPM packages. This is always stressful as I’m relying on them to gather the correct ones for me.

Thanks for reading! 🎉

email popup image
Mark Harwood
NEVER miss a blog post again! Subscribe for email notifications whenever a new post is live!
Subscribe
NEVER miss a blog post again! Subscribe for email notifications whenever a new post is live!
No obligation call, message, or email
Contact form image
I'll Be In Touch Soon