简体   繁体   中英

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.

使用IDENTIFIED BY运行GRANT语句:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM