CentOS 7系统安装 MariaDB

170 阅读1分钟
原文链接: blog.didiyun.com

MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护。MariaDB完全兼容MySQL,包括API和命令行。本文以滴滴云为例,介绍在CentOS 7系统安装MariaDB。

切换成为root

[dc2-user@didiyun ~]$ sudo su [root@didiyun dc2-user]#
1
2
3
[dc2-user@didiyun ~]$ sudo su
[root@didiyun dc2-user]#
 

安装Mariadb

[root@didiyun dc2-user]# yum install mariadb-server mariadb

启动Mariadb

[root@didiyun dc2-user]# systemctl start mariadb

验证是否启动

[root@didiyun dc2-user]# systemctl status mariadb

进入数据库,首次进入无密码

[root@didiyun dc2-user]# mysql

Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 3 Server version: 5.5.56-MariaDB MariaDB Server Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
1
2
3
4
5
6
7
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.56-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
 

关于密码和远程访问设置,请参看上一篇「CentOS 7 系统安装与远程连接 MySQL 5.7」