Centeros7下安裝Mysql 2018最新版,非常簡單


下載Mysql的rpm安裝包

shell> wget http://dev.mysql.com/get/ mysql-community-release-el7-5.noarch.rpm
安裝
shell> yum install mysql-community-release-el7-5.noarch.rpm
檢查mysql源是否安裝成功

shell> yum repolist enabled | grep "mysql.*-community.*"

 

然后直接就可以啟動服務
shell> service mysqld start

使用root登陸
shell> mysql -u root

mysql> update user set password=password("123456") where user="root";

開啟遠程訪問的權限
mysql> update user set host = "%" where user = "root";

刷新命令生效
mysql> flush privileges

最后別忘了關閉防火牆
CentOS 7.0默認使用的是firewall作為防火牆,這里改為iptables防火牆步驟。

1、關閉firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall開機啟動
firewall-cmd --state #查看默認防火牆狀態(關閉后顯示notrunning,開啟后顯示running)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM