建立的新用户,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’ ;
本文介绍了解决MySQL新用户仅能通过公网连接的问题,通过授予特定主机权限,允许用户使用localhost或127.0.0.1进行本地连接。
3203

被折叠的 条评论
为什么被折叠?



