从最新版本centos7开始,默认的是 Mariadb而不是mysql!
使用系统自带的repos安装很简单:
yum install mariadb mariadb-server
systemctl start mariadb ==> 启动mariadb
systemctl enable mariadb ==> 开机自启动
firewall-cmd --permanent --add-port=3306/tcp ==> 开放端口,允许远程访问
systemctl restart firewalld==> 重启防火墙
mysql_secure_installation ==> 设置 root密码等相关
mysql -uroot -p密码 ==> 测试登录!
授权root远程任何机器都能登陆
use mysql;
update mysql set host=‘%‘ where user=‘root‘ and host=‘localhost‘;
flush privileges;
或
grant all privileges on *.* to ‘root@%‘ identified by ‘密码‘ with grant option;
flush privileges;
本文出自 “蓝色的天空” 博客,请务必保留此出处http://shurk.blog.51cto.com/1134443/1745524
原文地址:http://shurk.blog.51cto.com/1134443/1745524