Upgrade Mysql (or MariaDB) to 10.x on CentOS 7

You will find all kinds of different instructions on how to update Mysql or MariaDB running on your CentOS 7 system to version 10.x, but the easiest and most straightforward way proven to us turned out to be the following one.

Note that the version in your case may vary, so replace 10.5 accordingly.

1. First, dump all the databases on your system just in case if something goes awry:

mysqldump -u root -p --all-databases > all-databases.sql

2. Paste the following code into the /etc/yum.repos.d/mariadb.repo file:

[mariadb-main]
name = MariaDB Server
baseurl = https://downloads.mariadb.com/MariaDB/mariadb-10.5/yum/rhel/7/x86_64
gpgkey = https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck = 1
enabled = 1

[mariadb-maxscale]
# To use the latest stable release of MaxScale, use "latest" as the version
# To use the latest beta (or stable if no current beta) release of MaxScale, use "beta" as the version
name = MariaDB MaxScale
baseurl = https://dlm.mariadb.com/repo/maxscale/latest/yum/rhel/7/x86_64
gpgkey = https://downloads.mariadb.com/MaxScale/MariaDB-MaxScale-GPG-KEY
gpgcheck = 1
enabled = 1

[mariadb-tools]
name = MariaDB Tools
baseurl = https://downloads.mariadb.com/Tools/rhel/7/x86_64
gpgkey = https://downloads.mariadb.com/MariaDB/MariaDB-Enterprise-GPG-KEY
gpgcheck = 1
enabled = 1

3. Update the database and reboot the system:

yum update && reboot

2. Backup old database configuration and install the new one:

mv /etc/my.cnf /etc/my.cnf.old
cp /etc/my.cnf.d/mysql-clients.cnf /etc/my.cnf

5. Make sure MariaDB is running:

systemctl status mariadb.service

If it's down, then start it up with:

systemctl start mariadb.service

Add new comment

Filtered HTML

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.