问题:"Host 'admin-PC' is not allowed to connect to this MySQLserver"   (其中,admin-PC为我的机器名)

 

原因:安装MySQL时没有勾选“Enable root access from remote machines”

 

有两种方式:

 

第一种操作:GRANT  ALL  ON  *.*  TO  root@"%"  IDENTIFIED  BY  "你自己的密码" ; //root用户的所有ip地址能访问所有的数据库

第二种操作:grant all privileges on test_db.* to root@'127.0.0.1' identified by '123456';  //root用户指定ip地址能访问的某个数据库

posted on 2017-07-11 10:02  想吃红烧小肥羊  阅读(476)  评论(0)    收藏  举报