Reference: https://mariadb.com/kb/zh-cn/installing-mariadb-with-yum/
The first thing to create MariaDB Repositories ( MariaDB installation source ) is/etc/yum.repos.d/
to create a MariaDB.repo file under . The content depends on the version and can be generated through the source generator : https://downloads.mariadb.org/mariadb/repositories/
For example, the content of the file under centos6.x is:
#
MariaDB 10.1 CentOS repository list - created 2016-05-13 10:03 UTC#
http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.1/centos6-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
After saving the file execute:
sudo yum install MariaDB-server MariaDB-client
The installation begins.
After the installation is complete, start MariaDB with the command:
sudo /etc/init.d/mysql start
Because the root password after installation is empty, you need to set and modify the root password:
mysqladmin -u root password 'root'