问题:"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地址能访问的某个数据库
浙公网安备 33010602011771号