title: Can't connect to MySQL server on 'x.x.x.x' (110)
body: <p>Hello I've an issue on MySQL I can't connect to it remotely, I already looked for the answers posted here but none of them works for me!</p>
  
  <p>This is the Error Message when I trying to connect to mysql</p>
  
  <pre><code>$&gt; mysql -u user01 -h x.x.x.x -p
  </code></pre>
  
  <hr>
  
  <ul>
  <li>ERROR 2003 (HY000): Can't connect to MySQL server on 'x.x.x.x' (110)</li>
  </ul>
  
  <hr>
  
  <p><strong>Telnet</strong></p>
  
  <pre><code>[root@machine2 ~]# telnet x.x.x.x 3306
  Trying x.x.x.x...
  telnet: connect to address x.x.x.x: Connection timed out
  </code></pre>
  
  <p>This the <code>IPTABLES</code> file</p>
  
  <pre><code>#Generated by iptables-save v1.4.7 on Thu Jan  4 21:58:18 2018
      *filter
      :INPUT ACCEPT [56:6256]
      :FORWARD ACCEPT [0:0]
      :OUTPUT ACCEPT [35:3538]
      -A INPUT -p tcp -m tcp --dport 3306 -m state --state NEW,ESTABLISHED -j ACCEPT 
      -A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT 
      -A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT 
      -A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT 
      -A INPUT -i lo -p tcp -m tcp --dport 3306 -j ACCEPT 
      -A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT 
      -A OUTPUT -p tcp -m tcp --sport 3306 -m state --state ESTABLISHED -j ACCEPT 
      COMMIT
  #Completed on Thu Jan  4 21:58:18 2018
  </code></pre>
  
  <p>-- I already create a user </p>
  
  <pre><code>CREATE USER 'user' IDENTIFIED BY 'pass';
  GRANT ALL PRIVILEGES ON *.* TO 'user';
  FLUSH PRIVILEGES;
  </code></pre>
  
  <p>and this is <code>my.cnf</code> file</p>
  
  <pre><code>#For advice on how to change settings please see
  #http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
  
  [mysqld]
  port=3306
  skip-name-resolve
  skip-external-locking
  innodb_buffer_pool_size=3G
  
  
  
  #
  # Remove leading # and set to the amount of RAM for the most important data
  # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
  # innodb_buffer_pool_size = 128M
  #
  # Remove leading # to turn on a very important data integrity option: logging
  # changes to the binary log between backups.
  # log_bin
  #
  # Remove leading # to set options mainly useful for reporting servers.
  # The server defaults are faster for transactions and fast SELECTs.
  # Adjust sizes as needed, experiment to find the optimal values.
  # join_buffer_size = 128M
  # sort_buffer_size = 2M
  # read_rnd_buffer_size = 2M
  datadir=/var/lib/mysql
  socket=/var/lib/mysql/mysql.sock
  
  # Disabling symbolic-links is recommended to prevent assorted security risks
  symbolic-links=0
  
  log-error=/var/log/mysqld.log
  pid-file=/var/run/mysqld/mysqld.pid
  </code></pre>
  
  <p>and My port 3306 is already open </p>
  
  <pre><code>[root@localhost ~]# netstat -petulan
  Active Internet connections (servers and established)
  Proto Recv-Q Send-Q Local Address               Foreign Address             State       User       Inode      PID/Program name
  tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      0          12889      2056/rpcbind
  tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      0          13930      2441/sshd
  tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      0          13141      2133/cupsd
  tcp        0      0 0.0.0.0:32895               0.0.0.0:*                   LISTEN      29         12977      2078/rpc.statd
  tcp        0      0 x.x.x.x:22           x.x.x.x:49964        ESTABLISHED 0          7891927    4453/sshd
  tcp        0     64 x.x.x.x:22           x.x.x.x:50203        ESTABLISHED 0          7892871    4482/sshd
  tcp        0      0 :::3306                     :::*                        LISTEN      27         7896831    6648/mysqld
  tcp        0      0 :::111                      :::*                        LISTEN      0          12892      2056/rpcbind
  </code></pre>
  
  <p>Is there something here wrong ?, thank you !</p>
  
  <p>I'm using <strong><code>CentOS 6.9</code></strong></p>