MySQL access denied 1045 error

2019-04-13 02:01发布

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.

1条回答
等我变得足够好
2楼-- · 2019-04-13 02:32

Run the GRANT statement with the IDENTIFIED BY:

GRANT ALL PRIVILEGES ON *.* TO 'testuser'@'%' IDENTIFIED BY '123456';
查看更多
登录 后发表回答