MariaDB is a branch of MySQL. It was developed by the father of MySQL. Since its acquisition by Oracle, MySQL has been updated slowly and has a tendency to close the source. Major companies have switched to Mariadb, including Facebook and Google.
My website runs in the PHP 7 environment of CentOS 7. Try MariaDB. If Mysql is installed, uninstall it first. Otherwise, it will conflict with MariaDB.
Follow these steps to install the MariaDB database on CentOS 7:
1. Create a new yum source
Command: vim/etc/yum. repos. d/MariaDB. repo
The content is as follows:
# MariaDB 10.1 CentOS repository list-created 2016-02-21 14:46 UTC
# Http://mariadb.org/mariadb/repositories/
[Mariadb]
Name = MariaDB
Base url = http://yum.mariadb.org/10.1/centos7-amd64
Gpgkey = https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
Gpgcheck = 1
2. Install MariaDB using yum
Run the following command:
Sudo yum install MariaDB-server MariaDB-client
Then install it all the way.
3. Start MariaDB
Command: service mariadb restart
If the prompt "Redirecting to/bin/systemctl restart mariadb. service" is displayed, it is started successfully.
4. Test MariaDB
The local machine enters the mysql-u root-p command on the terminal and then enters the password to log on to the database. This is the same as mysql. You must first set the database user name and password, in this step, you can search online.
MariaDB [(none)]> show databases;
+ ------- +
| Database |
+ ------- +
| Information_schema |
| Mysql |
| Performance_schema |
| Tanteng. me |
+ ------- +
4 rows in set (0.03 sec)