MySQL 访问被拒绝 1045 错误
我收到一个非常奇怪的错误,我使用以下凭据创建了一个用户“testuser”:
CREATE USER 'testuser'@'%' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON *.* TO 'testuser'@'%';
FLUSH PRIVILEGES;
我还修改了我的 /etc/mysql/my.cnf 不绑定到任何单个地址。 (哪个afaik应该接受来自任何地方的连接?)并重新启动mysql。
而且我可以在本地连接没有问题。
我正在 ubunutu 上的虚拟盒子内运行。
尝试从我的 Windows 计算机进行连接时,出现 MySQL 错误号 1045 用户“testuser”@“192.168.0.22”的访问被拒绝。
我确信这不是网络问题,因为更改主机或端口会产生不同的错误“无法连接到指定的实例”
以 root 身份登录并查看用户表 - 一切看起来都符合预期。 (单行,“%”表示主机和所有权限集。)
我整个下午都在用头撞墙......任何人都可以提出导致此错误的任何其他可能原因吗?
感谢您的任何帮助。
I'm getting a very strange error, I've created a user 'testuser' with the following credentials:
CREATE USER 'testuser'@'%' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON *.* TO 'testuser'@'%';
FLUSH PRIVILEGES;
I have also modified my /etc/mysql/my.cnf not to bind to any single address. (Which afaik should accept connections from anywhere?) And restarted mysql.
And I can connect locally no problem.
I am running inside a virtual box on ubunutu.
Trying to connect from my windows machine, gives me MySQL error number 1045 Access denied for user 'testuser'@'192.168.0.22'.
I'm confident that it's not a networking problem as changing the host or port gives a different error "Cannot connect to the specified instance"
Logging in as root and looking at the users table - all looks as expected. (Single row, '%' for host and all permissions set.)
I've been banging my head against the wall all afternoon... can anyone suggest any other possible causes for this error?
Thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
IDENTIFIED BY
运行GRANT
语句:Run the
GRANT
statement with theIDENTIFIED BY
: