Linux下的Mysql的远程访问

mysql的服务端[192.168.25.136]

1,在远程访问之前需先配置防火墙  service iptables stop (不推荐,可配置开通3306端口)

2,授权

mysql> grant all on wordpress.* to wordpress@'192.168.25.%' identified by 'root';

mysql>select host,user from user; 【多出1条远程登录用户记录】

mysql>flush privileges;(刷新)

image

 

mysql的客户端[192.168.25.144]

mysql  -h 192.168.25.136  -uroot -proot
posted @ 2018-07-11 22:17  小a玖拾柒  阅读(377)  评论(0编辑  收藏  举报