連線遠端伺服器上的MySQL
阿新 • • 發佈:2020-11-07
一、首先檢查伺服器提供商的安全組協議
二、開啟防火牆對應的埠
systemctl start firewalld
systemctl status firewalld
firewall-cmd --zone=public --add-port=3306/tcp --permanent
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;