[Ilugc] MySQL - unable to connect to MySQL db from another host on same LAN

  • From: bala150985@xxxxxxxxx (Balasubramaniam Natarajan)
  • Date: Wed, 6 Aug 2014 12:16:57 +0530

On Wed, Aug 6, 2014 at 12:09 PM, Arun Khan <knura9 at gmail.com> wrote:

I have 2 AWS instances (CentOS 6.5 64bit AMI)
(a) Apache, PHP, mysql client package  (IP = A, alias name aws-appsrv)
(b) mysql-server (IP = B alias name aws-dbsrv).

I have configured mysql server on B to accept connections on 3306 from A.
I have also configured mysql server on B to accept connections for
'root' user from A both with IP number (A) and alias name
(aws-appsrv).

On mysql server (B)
mysql> select user,host,grant_priv from user;
+------+------------+------------+
| user | host       | grant_priv |
+------+------------+------------+
| root | localhost  | Y          |
| root | aws-appsrv | Y          |
| root | 127.0.0.1  | Y          |
| root | 10.0.0.244 | Y          |
+------+------------+------------+

On aws-appsrv (A), when I connect to mysql server on B as 'root' user,
I get the following error.

# mysql -u root -h aws-dbsrv -D mysql -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'aws-appsrv' (using
password: YES)

I have searched for a solution but have not come across one that meets
my use case scenario.

What am I missing?



1. Could you try logging in locally by adding an appropriate grant
statement ?

2. Try using the FQDN for the grant statement on mysql
server.
                             GRANT ALL ON YourDB.* TO 'root'@
'mysql_root_password';
                             FLUSH PRIVILEGES;

-- 
Regards,
Balasubramaniam Natarajan
http://blog.etutorshop.com

Other related posts: