1,在遠程訪問以前需先配置防火牆 service iptables stop (不推薦,可配置開通3306端口)html
2,受權mysql
mysql> grant all on wordpress.* to wordpress@'192.168.25.%' identified by 'root'; mysql>select host,user from user; 【多出1條遠程登陸用戶記錄】 mysql>flush privileges;(刷新)
mysql -h 192.168.25.136 -uroot -proot