---
title: 'How to install MariaDB 10.8 on CentOS 7 or upgrade from mysql 5.7 | Zomro'
description: 'In this tutorial, we will see how to install MariaDB 10.8 on CentOS 7 and upgrade from mysql 5.7 to MariaDB 10.8 on CentOS 7. MariaDB is a MySQL replacement.'
image: 'https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48@server-panel.net/2022/08/01/1661857553_1.png'
---

![opened image]()

  * [Zomro](https://zomro.com/)
  * [FAQ](https://zomro.com/blog/faq/)
  * How to install MariaDB 10.8 on CentOS 7 or upgrade from mysql 5.7 



# How to install MariaDB 10.8 on CentOS 7 or upgrade from mysql 5.7

25-08-2022

In this tutorial, we will see how to install MariaDB 10.8 on CentOS 7 and upgrade from mysql 5.7 to MariaDB 10.8 on CentOS 7. MariaDB is a MySQL replacement.  


**Install MariaDB 10.8 on CentOS 7**

  
If you have any other MySQL-based database management system installed on your system, go to the section below to upgrade. Therefore, to continue the installation, make sure that the system is clean.

  
First, update the OS and reboot the system.
    
    
    yum update -y
    reboot -f

  
Wait for the new packages to finish installing, and after restarting, add the new MariaDB repository.  
  
We will use the official MariaDB repository for RHEL, which we will add using the following commands.  
  
Downloading:
    
    
    curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup

  
Now let's run the script that automatically installs MariaDB. We will also specify version 10.8 for installation.
    
    
    bash mariadb_repo_setup --mariadb-server-version=10.8

  
![How to install MariaDB 10.8 on CentOS 7 or upgrade from mysql 5.7 - 1](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48@server-panel.net/2022/08/01/1661857553_1.png)  
The repository will be set up and the MariaDB GPG keys will be imported.  
  
![How to install MariaDB 10.8 on CentOS 7 or upgrade from mysql 5.7 - 2](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48@server-panel.net/2022/08/01/1661857979_2.png)  
Let's look at the list of all available repositories in our system.
    
    
    yum repolist

  
As you can see, MariaDB 10.8 packages are available in the newly added repository. Now let's install MariaDB 10.8 on our server.
    
    
    yum install MariaDB-server MariaDB-client MariaDB-backup -y

  
We confirm the version of the installed packages of the server, the MariaDB client and wait for the installation to complete.  
  
![How to install MariaDB 10.8 on CentOS 7 or upgrade from mysql 5.7 - 3](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48@server-panel.net/2022/08/01/1661858495_4.png)  
After successful installation, check the version of MariaDB installed.
    
    
    rpm -qi MariaDB-server

  
![How to install MariaDB 10.8 on CentOS 7 or upgrade from mysql 5.7 - 4](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48@server-panel.net/2022/08/01/1661858915_5.png)  
Now you need to add the mariadb database service to autoload.
    
    
    systemctl enable --now mariadb

  
![How to install MariaDB 10.8 on CentOS 7 or upgrade from mysql 5.7 - 5](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48@server-panel.net/2022/08/01/1661859102_6.png)  
Check the status of the service to see if it is running.  
  
![How to install MariaDB 10.8 on CentOS 7 or upgrade from mysql 5.7 - 6](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48@server-panel.net/2022/08/01/1661859305_7.png)  
Now you can create a database with access that is convenient for you.

## **Upgrade from MySQL 5.7 to MariaDB 10.8**

Before upgrading, it is recommended to backup the databases, copy the **/var/lib/mysq/** directory or, as usual, dump the database with the command:
    
    
    mysqldump --all-databases > dump_databases.sql

  
  
We can use the site **https://mariadb.org/download/?t=repo-config &d=CentOS+7+%28x86_64%29&v=10.8&r_m=xtom_dus** and add the repository manually.  
  
![How to install MariaDB 10.8 on CentOS 7 or upgrade from mysql 5.7 - 7](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48@server-panel.net/2022/08/01/1661862116_8.png)  
We copy the generated code into a new mariadb.repo file. We can create it with the command:
    
    
    vim /etc/yum.repos.d/mariadb.repo

  
And paste the code copied below into it and save.
    
    
    # MariaDB 10.8 CentOS repository list - created 2022-08-30 12:17 UTC
    # https://mariadb.org/download/
    [mariadb]
    name=MariaDB
    baseurl=https://mirrors.xtom.de/mariadb/yum/10.8/centos7-amd64
    gpgkey=https://mirrors.xtom.de/mariadb/yum/RPM-GPG-KEY-MariaDB
    gpgcheck=1

  
Or, with the commands above, which were entered to install MariaDB 10.8, add the repository and GPG keys.
    
    
    curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
    bash mariadb_repo_setup --mariadb-server-version=10.8

  
Stop the database service:
    
    
    systemctl stop mariadb

  
Delete if version 10.2 and higher is already installed:
    
    
    yum remove MariaDB-server-10.*

  
Install:
    
    
    yum install MariaDB-server MariaDB-client MariaDB-backup

  
After successful installation, start the database.
    
    
    systemctl start mariadb

  
We are upgrading the databases.
    
    
    mysql_upgrade

  
Check with command:
    
    
    rpm -qi MariaDB-server

  
or
    
    
    mysql

  
![How to install MariaDB 10.8 on CentOS 7 or upgrade from mysql 5.7 - 8](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48@server-panel.net/2022/08/01/1661863190_10.png)  
If you need to load the database, use the command:
    
    
    mysql < dump_databases.sql

  
After a successful installation or upgrade, we can enjoy the new version of MariaDB.

Similar articles:

[How to change the SSH connection port and disable password authorization](https://zomro.com/blog/faq/236-kak-izmenit-port-podkljuchenija-po-ssh-i-otkljuchit-avtorizaciju-po-parolju) [How to change language in Windows Server 2019, 2016](https://zomro.com/blog/faq/274-kak-smenit-jazyk-v-windows-server-2019-2016) [Windows Remote Desktop Connection on Macbook](https://zomro.com/blog/faq/356-windows-remote-desktop-connection-on-macbook) [Changing Priority from IPv6 to IPv4 in Ubuntu and CentOS: A Complete Guide](https://zomro.com/blog/faq/471-changing-priority-from-ipv6-to-ipv4-in-ubuntu-and-centos-a-complete-guide) [MacOS: How to perform MTR check](https://zomro.com/blog/faq/101-macos-kak-vypolnit-proverku-mtr)

[ Virtual hosting from €3.98/mon ](/virtual)
