Remote connect to mysql server?

Posted by LF4 on Server Fault See other posts from Server Fault or by LF4
Published on 2012-09-08T02:56:53Z Indexed on 2012/09/08 3:39 UTC
Read the original article Hit count: 162

Filed under:
|

I've been trying to figure out why I keep getting this error when I try to connect to the MySQL server with the following commands.

$~ mysql -u username -h SQLserver -p
Enter password:
ERROR 1045 (28000): Access denied for user 'username'@'myIP' (using password: YES)

I've done the following:
Port is open in the firewall other wise I wouldn't get the error it'd just timeout.
MySQL server not running with skip-networking or bind-address
username has host as '%' and I can connect locally so the password is correct.

GRANT USAGE ON *.* TO username@% IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

I wanted to know if anyone had ideas or ran into this issue before and solved it?

mysql> select user, host from mysql.user where user='username';
+----------+------+
|   user   | host |
+----------+------+
| username | %    |
+----------+------+
1 row in set (0.00 sec)

mysql> show grants for 'username';
+----------------------------------------------------------------------------------------------------------------+
| Grants for username@%                                                                                            |
+----------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' IDENTIFIED BY PASSWORD '*F42AD03PASSWORDHASHADF4021C86B' |
| GRANT ALL PRIVILEGES ON `DB2`.* TO 'username'@'%'                                                           |
+----------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

© Server Fault or respective owner

Related posts about mysql

Related posts about remote-access