问题
I've created a user (1caap) in mysql root account and given read only privileges for this user to one of my database. Now my client(1caapuser) is unable to access this database. I've established the connection using Workbench. He's getting the following error when he's trying to access this database using DBVisualizer:
An error occurred while establishing the connection:
Type: java.sql.SQLException Error Code: 1045 SQL State: 28000
Message:
Access denied for user '1caapuser'@'x.x.x.x' (using password: YES)
Please help me out if i'd missed any settings at the earliest.
回答1:
To resolve this issue you have to grant all privileges on database with identified by the password
Command to run:
GRANT ALL PRIVILEGES ON yourDBname
.* TO username@'%' IDENTIFIED BY 'password';
回答2:
Check the following for more details about the error you get:
http://dev.mysql.com/doc/refman/5.1/en/access-denied.html
https://dev.mysql.com/doc/refman/8.0/en/error-access-denied.html
You must most likely grant proper access for the user at the given IP address/host name. Such as:
grant on . to ''@'';
Check the users guide which specific privileges and what target objects to grant. The important clause above is that you need to specify 'user'@'ip-address'.
Again, check the users guide as there may be a collection of reasons for the error you get.
来源:https://stackoverflow.com/questions/19044066/mysql-connection-with-dbvisualizer