linux Mysql允许远程IP登录!

grant all privileges on *.* to 'root' @'192.168.1.103' identified by '123456';
flush privileges; 
 
 
登录MySQL
# mysql -uroot -p
如果无法登录可以使用find / -name mysql搜索mysql程序的路径,比如mysql程序路径为:/usr/local/mysql/bin/mysql,我们可以这样登录:
# /usr/local/mysql/bin/mysql -uroot -p
执行如下命令:
#grant all privileges on *.* to 'root' @'192.168.0.1' identified by '123456';
#flush privileges; 
# exit
192.168.0.1是连接mysql服务器的客户端ip,如果指定所有,则用%来表示。
posted @ 2014-09-25 15:35  扬了二正  阅读(852)  评论(0编辑  收藏  举报