title: cPanel Mysql Remote Connection ERROR 2003 (HY000)
body: <p>Mysql server works with no problems on a shared hosting box.<br>
  PHP works fine,connects to mysql and serves site just fine through apache.
  cPanel works with no issues.</p>
  
  <p>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 ('%').</p>
  
  <p>my.cnf contents:</p>
  
  <pre><code>[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
  </code></pre>
  
  <p>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</p>
  
  <p>tcpdump output while trying to connect:</p>
  
  <pre><code>#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 &gt; 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 &gt; 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 &gt; 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 &gt; 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 &gt; 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 &gt; 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
  </code></pre>
  
  <p>IPTABLES RULES</p>
  
  <pre><code>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 
  ....
  </code></pre>
  
  <p>netstat output</p>
  
  <pre><code>#netstat -nat |grep :3306
  tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN  
  </code></pre>
  
  <p>Still no luck. Cannot connect to Mysql with the same error:</p>
  
  <p>ERROR 2003 (HY000): Can't connect to MySQL server on 'x.x.x.x' (110)</p>