在centos7中安装MariaDB

安装

1
yum install -y mariadb-server mariadb 

启用与停止

1
2
3
4
systemctl start mariadb  #启动MariaDB
systemctl stop mariadb #停止MariaDB
systemctl restart mariadb #重启MariaDB
systemctl enable mariadb #设置开机启动

开启远程访问

1
2
3
4
mysql -u root -p
> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'newpass' WITH GRANT OPTION;
> FLUSH PRIVILEGES;
> exit;