1. 程式人生 > >debian系統mysql遠端連結10060/10045

debian系統mysql遠端連結10060/10045

debian系統遠端資料庫連不上,首先要監聽防火牆埠

iptables -I INPUT -p tcp --dport 3306 -j ACCEPT

防火牆生效

iptables-save > /etc/iptables

再本機進入資料庫

先改host=>%

mysql -u root -p
use mysql;
update user set host = '%' where user = 'root'  and host='localhost';
flush privileges;

再給遠端許可權

grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option; 

FLUSH PRIVILEGES;