建立的新用户,xxx@’%’,授权后,本地只能通过公网链接,不能通过localhost或者127.0.0.1链接,解决方案:赋予对应主机权限。
如:
grantall privileges on *.* to xxx@localhost identified by ‘password’ ;
grantall privileges on mydb.* to xxx@localhost identified by ‘password’ ;
grantall privileges on mydb.* to xxx@127.0.0.1 identified by ‘password’ ;