天天看點

centos7 yum安裝 mariadb

從最新版本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; 

     本文轉自whshurk 51CTO部落格,原文連結:http://blog.51cto.com/shurk/1745524,如需轉載請自行聯系原作者

繼續閱讀