trying to connect to mysql and getting error :is not allowed to connect to this MySQL serverConnection closed by foreign host

mysql

Solution

You cannot connect to the remote MySQL if you are not white listed in the MySQL user privileges table.

Let's assume your IP address is `199.255.209.168` and you are trying to log into the MySQL daemon running at IP address `123.238.18.47` by the username `rakman` with some password

$ mysql -h 123.238.18.47 -u rakman -p
Enter password:
ERROR 1130 (HY000): Host '199.255.209.168' is not allowed to connect to this MySQL server

A mysql user [rakman]@[your IP address] needs to be present in the user privileges of MySQL running at `123.238.18.47`. So `rakman@199.255.209.168` (or `rakman@%` which will allow logging in to this MySQL from ANY remote host but is not recommended) needs to be present in the user privileges of MySQL running at `123.238.18.47`.

For the MySQL commands on how to achieve this, you can see the accepted answer at Host 'xxx.xx.xxx.xxx' is not allowed to connect to this MySQL server. If you try to login after that.

$ mysql -h 123.238.18.47 -u rakman -p
Enter password:
Welcome to the MySQL monitor.

Problem

Hi i am running two rhel instances in ec2. now i am trying to do $telnet ec2-184-73-58-163.compute-1.amazonaws.com 3306 ``` Trying 10.193.139.147... Connected to ec2-184-73-58-163.compute-1.amazonaws.com. Escape character is '^]'. bHost 'domU-12-31-39-05-3D-E6.compute-1.internal' is not allowed to connect to this MySQL serverConnection closed by foreign host. ``` I am a newbie. not getting what to do now? Please help.

Original source

Related problems