Chris
Chris

Reputation: 6246

MySQL access denied 1045 error

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.

Upvotes: 3

Views: 29361

Answers (1)

Michael Berkowski
Michael Berkowski

Reputation: 270607

Run the GRANT statement with the IDENTIFIED BY:

GRANT ALL PRIVILEGES ON *.* TO 'testuser'@'%' IDENTIFIED BY '123456';

Upvotes: 9

Related Questions