連接遠程服務器上的MySQL


一、首先檢查服務器提供商的安全組協議

二、打開防火牆對應的端口

systemctl start firewalld
systemctl status firewalld
firewall-cmd --zone=public --add-port=3306/tcp --permanent//開啟3306端口
firewall-cmd --zone=public --add-port=3306/udp --permanent

三、在服務器上進入mysql

mysql -uroot -p //可以不顯式寫密碼

四、在mysql命令行中輸入

grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;//賦予權限
flush privileges;//刷新權限

五、在mysql圖形界面軟件中連接


免責聲明!

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



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