0

Mysql server works with no problems on a shared hosting box.
PHP works fine,connects to mysql and serves site just fine through apache. cPanel works with no issues.

Went to specific account's cPanel and added to "Remote MySql" remote hosts IPs and when this didn't work wildcard to allow anyone to connect ('%').

my.cnf contents:

[mysqld]
local-infile=0

max_connections=200
table_open_cache=256
max_delayed_threads=20
max_tmp_tables=32
query_cache_type=1
query_cache_size=4M
thread_cache_size=4
innodb_file_per_table=1
open_files_limit=30428
max_allowed_packet=268435456
bind-address = x.x.x.x

innodb_buffer_pool_size=8M
[mysqldump]
events

Note: tried both 0.0.0.0 in the bind address and my server's primary and secondary ips. Also tried without ANY bind-address

tcpdump output while trying to connect:

#tcpdump -i any port 3306
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 65535 bytes
16:52:24.382293 IP x.x.x.x.59222 > x.x.x.x.mysql: Flags [S], seq 4293479800, win 29200, options [mss 1380,sackOK,TS val 4646672 ecr 0,nop,wscale 7], length 0
16:52:25.379861 IP x.x.x.x.59222 > x.x.x.x.mysql: Flags [S], seq 4293479800, win 29200, options [mss 1380,sackOK,TS val 4646922 ecr 0,nop,wscale 7], length 0
16:52:27.383794 IP x.x.x.x.59222 > x.x.x.x.mysql: Flags [S], seq 4293479800, win 29200, options [mss 1380,sackOK,TS val 4647423 ecr 0,nop,wscale 7], length 0
16:52:31.387599 IP x.x.x.x.59222 > x.x.x.x.mysql: Flags [S], seq 4293479800, win 29200, options [mss 1380,sackOK,TS val 4648424 ecr 0,nop,wscale 7], length 0
16:52:39.403709 IP x.x.x.x.59222 > x.x.x.x.mysql: Flags [S], seq 4293479800, win 29200, options [mss 1380,sackOK,TS val 4650428 ecr 0,nop,wscale 7], length 0
16:52:55.419900 IP x.x.x.x.59222 > x.x.x.x.mysql: Flags [S], seq 3596828352, win 29200, options [mss 1380,sackOK,TS val 4654432 ecr 0,nop,wscale 7], length 0
6 packets captured
6 packets received by filter
0 packets dropped by kernel

IPTABLES RULES

Chain INPUT (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     tcp  --  all    any     anywhere             anywhere            tcp dpt:mysql 
  36M 6414M acctboth   all  --  any    any     anywhere             anywhere            
    0     0 ACCEPT     tcp  --  !lo    any     ns5.servint.net      anywhere            tcp dpt:domain 
    0     0 ACCEPT     udp  --  !lo    any     ns5.servint.net      anywhere            udp dpt:domain 
    0     0 ACCEPT     tcp  --  !lo    any     ns5.servint.net      anywhere            tcp spt:domain 
....

netstat output

#netstat -nat |grep :3306
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN  

Still no luck. Cannot connect to Mysql with the same error:

ERROR 2003 (HY000): Can't connect to MySQL server on 'x.x.x.x' (110)

Ioannis Loukeris
  • 300
  • 2
  • 10

1 Answers1

0

This may be oversimplifying, but have you restarted Mysql?

Your error is consistent with a config that doesn't have a bind address in the config, but I do see yours. I just wonder if the config has been loaded since you edited it: ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)

Also, have you tried your actual IP address instead of a wildcard for testing purposes in Cpanel where you configure the remote access for the Mysql User?

I hope this helps!

Community
  • 1
  • 1
DevOops
  • 943
  • 2
  • 10
  • 21
  • I have restarted mysql after each change in my.cnf and yes, both wildcard and non-wildcard hosts were entered in cPanel. The my.cnf is the actual file read by the server as indicated by the mysqld --help --verbose command which returns : `Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf ` /etc/my.cnf is the file i edit – Ioannis Loukeris Mar 04 '15 at 16:31
  • Can you please paste the command you are using to connect to mysql remotely? – DevOops Mar 04 '15 at 20:21
  • I also don't see a skip-networking or skip-eternal-locking directives in your my.cnf, can you add these two lines as well and retry? skip-external-locking skip-networking – DevOops Mar 04 '15 at 20:22
  • mysql -p -h x.x.x.x -u myUserName is the connection command skip-networking is off as seen by the mysqladmin variables command. Also skip-external-locking has to do something with this ? I thought that it was for myisam checking and packing ... – Ioannis Loukeris Mar 05 '15 at 09:00