Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

Host is not allowed to connect to this MySQL server

SOLVED
Go to solution
Chris Gersch
Occasional Advisor

Host is not allowed to connect to this MySQL server

A perplexing problem.
Whenever I try to telnet to the remote server on port 3306 it comes up with the not allowed to connect error. I have my hosts entries in mysql setup correctly so that's not an issue. Could this be a name resolving issue? Am using HP-UX 11.11
Many thanks,
Chris Gersch
6 REPLIES
Steven Sim Kok Leong
Honored Contributor

Re: Host is not allowed to connect to this MySQL server

Hi,

To aid troubleshooting, try connecting to the IP address and port number.

# telnet ip_addr_of_mysql_server 3306

Trying...
Connected to mysql_server.
Escape character is '^]'.

Does it get connected?

Hope this helps. Regards.

Steven Sim Kok Leong
Email: steven@beepz.com. Homepage: https://www.beepz.com
Chris Gersch
Occasional Advisor

Re: Host is not allowed to connect to this MySQL server

Yeah - have done that. On local host I can:

#telnet localhost 3306

and it connects fine. From a remote machine however it doesn't make the initial connection and replys straight away with the "can't connect" error.
Chris Gersch
Occasional Advisor

Re: Host is not allowed to connect to this MySQL server

oops - sorry, I've tried to telnet to "localhost", AND "ip_of_mysql_server", and "host_name" from both the localhost and remote hosts. Localhost it all works fine - not a problem. However anywhere else and it doesn't connect.
Steven Sim Kok Leong
Honored Contributor

Re: Host is not allowed to connect to this MySQL server

Hi,

Are you able to connect to other services on the remote server from your client?

1) traceroute ip_addr_of_mysql_server
2) telnet ip_addr_of_mysql_server 22 (assuming if SSHD is running)

If 1) is not working, check that you can ping the ip_addr_of_default_route and that the default route has been defined in your routing table (netstat -rn to verify).

If 1) and 2) works, then you are probably having a ip-filtering mechanism to restrict accesses. Check whether you are using a network-based firewall, host-based firewall or tcpwrapper to filter connections.


Hope this helps. Regards.

Steven Sim Kok Leong
Email: steven@beepz.com. Homepage: https://www.beepz.com
Bill Hassell
Honored Contributor
Solution

Re: Host is not allowed to connect to this MySQL server

Is there a /etc/resolv.conf file in the SQL server? If so, the /etc/nsswitch.conf file will determine whether the IP address will be security-checked by /etc/hosts or some DNS server. For database systems, don't rely on a DNS server for production. Always put the important addresses into /etc/hosts, then make sure nsswitch.conf has:

hosts: files[NOTFOUND=continue UNAVAIL=continue] dns [NOTFOUND=return UNAVAIL=continue TRYAGAIN=return]

This will insure that your server will not fail due to a DNS problem.


Bill Hassell, sysadmin
Chris Gersch
Occasional Advisor

Re: Host is not allowed to connect to this MySQL server

Thanks all - just had to play around with the /etc/hosts file to make it recognise the appropriate hosts and flush-hosts within mysql and everything is working like a charm:)

Chris