在CentOS7中,MariaDB 替代了MySQL;更多复杂的疑问可以在这里查看 MariaDB versus MySQL – Compatibility
Install MySQL / MariaDB
安装MariaDB:
yum -y install mariadb-server mariadb
启动MySQL, 现在是 MariaDB:
systemctl start mariadb
MySQL/MariaDB 开机启动:
systemctl enable mariadb
检查 MySQL/MariaDB的状态:
systemctl status mariadb
停止 MySQL/MariaDB:
systemctl stop mariadb
检查命令客户端的安装:
mysql
Welcome to the MariaDB monitor. Commands end with ; or g.
Your MariaDB connection id is 3
Server version: 5.5.40-MariaDB MariaDB Server
Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
MariaDB [(none)]>
注:刚安装完是无法远程连接的,因为CentOS7 默认是开启了防火墙,怎么放开3306端口,请查看这里