Unable to connect to remote MySQL

While setting developer portal from remote SQL server we see below error while configuration.

Resolve all issues below to continue the installation. For help configuring your database server, see the installation handbook, or contact your hosting provider.

Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 104.

  • Is the database server running?
  • Does the database exist, and have you entered the correct database name?
  • Have you entered the correct username and password?
  • Have you entered the correct database hostname?

==

Made below changes in /etc/hosts.allow

==

# hosts.allow This file contains access rules which are used to

# allow or deny connections to network services that

# either use the tcp_wrappers library or that have been

# started through a tcp_wrappers-enabled xinetd.

#

# See 'man 5 hosts_options' and 'man 5 hosts_access'

# for information on rule syntax.

# See 'man tcpd' for information on tcp_wrappers

#

SSHD: ALL

mysqld: ALL: allow

==

mysqld is running:

ps -ef |grep mysqld

root 18572 1 0 18:33 pts/0 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql

mysql 18674 18572 0 18:33 pts/0 00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --log-

==

service iptables status iptables: Firewall is not running.

-Vinay

Solved Solved
0 6 4,970
1 ACCEPTED SOLUTION

Issue was resolved as there was a issue at firewall end from devportal server to mysql server.Network team resolved it and able to connect now.

View solution in original post

6 REPLIES 6

Also have the grants as well.

GRANT ALL PRIVILEGES ON *.* TO 'abc'@'xxxx' IDENTIFIED BY 'test' WITH GRANT OPTION;

there could be couple of problems,

1> usually firewall, but doesn't look like thats the problem in your case

2> tcp_wrappers looks good,

3> bind address - could be that your remote mysql is bound to localhost rather than the internal IP of this instance. can you telnet to the remote mysql:port?, if this is the problem - pls refer here,

http://forums.mysql.com/read.php?52,151255,213970#msg-213970

Tried as per instructions but didn't help.We have strict hardening policies on the servers.Any pointers to resolve the issue? -Vinay

were you able to telnet to the remote port?

Yes.I am able to connect. telnet 10.XXX.1X.XXX 3306 Trying 10.1XXX.1X.XXX... Connected to 10.1XXX.1X.XXX. Escape character is '^]'.

Issue was resolved as there was a issue at firewall end from devportal server to mysql server.Network team resolved it and able to connect now.