1. Add the mariadb yum data source
Create the Mariadb.repo file into the/etc/yum.repos.d/folder (the file name is customized, but it is recommended to name Mariadb.repo, which is the official name):
Cd/etc/yum.repos.d/sudo Vim/etc/yum.repos.d/mariadb.repo
Then write the following (from the official):
# MariaDB 10.0 CentOS repository list-created 2015-05-12 02:16 utc# Http://mariadb.org/mariadb/repositories/[mariadb]na me = Mariadbbaseurl = http://yum.mariadb.org/10.0/centos7-amd64gpgkey=https://yum.mariadb.org/ Rpm-gpg-key-mariadbgpgcheck=1
The above configuration contains the Gpgkey command line, which automatically obtains the GPG key we use to sign the source, which allows Yum and RPM to verify the integrity of the downloaded package.
2. Install mariadb with Yum
sudo yum install mariadb-server mariadb-client
If you have not yet installed the GPG signing key, Yum will prompt you to install it (before installing the package) after downloading the package. If the server already has the Mariadb-galera-server package installed, you may need to remove it before installing mariadb-server (using sudo yum remove mariadb-galera-server), Deleting a mariadb-galera-server RPM package does not delete any databases, but any upgrade should be backed up first. Note: When installing, you can use-y to confirm without prompting. Here, the server and the client are installed, which is generally the case for installing both.
Centos7 under Installation mariadb