MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可 MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能轻松成为MySQL的代替品。
本文介绍CentOS7.6安装MariaDB过程。
执行安装命令:
[root@db ~]# yum -y install mariadb*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* epel: mirrors.njupt.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.60-1.el7_5 will be installed
---> Package mariadb-bench.x86_64 1:5.5.60-1.el7_5 will be installed
---> Package mariadb-devel.x86_64 1:5.5.60-1.el7_5 will be installed
---> Package mariadb-embedded.x86_64 1:5.5.60-1.el7_5 will be installed
---> Package mariadb-embedded-devel.x86_64 1:5.5.60-1.el7_5 will be installed
---> Package mariadb-libs.x86_64 1:5.5.60-1.el7_5 will be installed
---> Package mariadb-server.x86_64 1:5.5.60-1.el7_5 will be installed
--> Processing Dependency: perl-DBD-MySQL for package: 1:mariadb-server-5.5.60-1.el7_5.x86_64
---> Package mariadb-test.x86_64 1:5.5.60-1.el7_5 will be installed
--> Running transaction check
---> Package perl-DBD-MySQL.x86_64 0:4.023-6.el7 will be installed
--> Finished Dependency Resolution
....
开机自动启动MariaDB:
[root@db ~]# systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
启动MariaDB:
[root@db ~]# systemctl start mariadb
查看MariaDB状态:
[root@db ~]# systemctl status mariadb
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2019-09-13 22:54:44 CST; 32s ago
Process: 3280 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
Process: 3201 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Main PID: 3279 (mysqld_safe)
CGroup: /system.slice/mariadb.service
├─3279 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
└─3441 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket=/va...
Sep 13 22:54:42 db mariadb-prepare-db-dir[3201]: '/usr/bin/mysql_secure_installation'
Sep 13 22:54:42 db mariadb-prepare-db-dir[3201]: which will also give you the option of removing the test
Sep 13 22:54:42 db mariadb-prepare-db-dir[3201]: databases and anonymous user created by default. This is
Sep 13 22