title: Enable mySQL remote connections port 3306 Plesk 11.5 CENTOS
body: <p>I am having problems connecting to our mysql server remotely. We have 2 servers both running Plesk 11.5 one of them is linux (IP 99.99.99.99) and the other is Windows R2 2008 (IP 88.88.88.88).</p>
  
  <p>Note: These are not the true IP addresses but for security I have replaced them with those above.</p>
  
  <p>I am trying to connect to the mysql server on the linux machine from the windows machine. I am connecting via PHP scripts using mysqli</p>
  
  <pre><code>Warning: mysqli::mysqli() [mysqli.mysqli]: (HY000/2003): Can't connect to MySQL server on '99.99.99.99' (10060) in C:\Inetpub\vhosts\oldburywells.co.uk\httpdocs\setup\includes\db.php on line 12
  Failed to connect to MySQL: (2003) Can't connect to MySQL server on '99.99.99.99' (10060)
  </code></pre>
  
  <p>The contents of /etc/my.cnf is below:</p>
  
  <pre><code>[mysqld]
  set-variable=local-infile=0
  datadir=/var/lib/mysql
  socket=/var/lib/mysql/mysql.sock
  user=mysql
  # Default to using old password format for compatibility with mysql 3.x
  # clients (those using the mysqlclient10 compatibility package).
  # Forced OLD_PASSWORD format is turned OFF by Plesk
  #old_passwords=1
  port=3306
  bind-address=99.99.99.99
  # skip-networking
  
  [mysqld_safe]
  log-error=/var/log/mysqld.log
  pid-file=/var/run/mysqld/mysqld.pid
  </code></pre>
  
  <p>In the mysql database - db table the record for the host is this ignore the insert statement, this was the easiest way for me to display the options:</p>
  
  <pre><code>INSERT INTO `db` (`Host`, `Db`, `User`, `Select_priv`, `Insert_priv`, `Update_priv`, `Delete_priv`, `Create_priv`, `Drop_priv`, `Grant_priv`, `References_priv`, `Index_priv`, `Alter_priv`, `Create_tmp_table_priv`, `Lock_tables_priv`, `Create_view_priv`, `Show_view_priv`, `Create_routine_priv`, `Alter_routine_priv`, `Execute_priv`) VALUES
  ('%', 'designjazzsetup', 'designjazzsu', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');
  </code></pre>
  
  <p>The user record in the user table looks like this:</p>
  
  <pre><code>INSERT INTO `user` (`Host`, `User`, `Password`, `Select_priv`, `Insert_priv`, `Update_priv`, `Delete_priv`, `Create_priv`, `Drop_priv`, `Reload_priv`, `Shutdown_priv`, `Process_priv`, `File_priv`, `Grant_priv`, `References_priv`, `Index_priv`, `Alter_priv`, `Show_db_priv`, `Super_priv`, `Create_tmp_table_priv`, `Lock_tables_priv`, `Execute_priv`, `Repl_slave_priv`, `Repl_client_priv`, `Create_view_priv`, `Show_view_priv`, `Create_routine_priv`, `Alter_routine_priv`, `Create_user_priv`, `ssl_type`, `ssl_cipher`, `x509_issuer`, `x509_subject`, `max_questions`, `max_updates`, `max_connections`, `max_user_connections`) VALUES
  ('%', 'designjazzsu', '*812A9EC8DA3040D2FBE1FDE5A71B25011F43A358', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', '', '', '', '', 0, 0, 0, 0);
  </code></pre>
  
  <p>The contents of /etc/sysconfig/iptables:</p>
  
  <pre><code># Generated by iptables-save v1.3.5 on Tue Mar 25 10:57:08 2014
  *filter
  :INPUT ACCEPT [789031949:87191570991]
  :FORWARD ACCEPT [0:0]
  :OUTPUT ACCEPT [261535305:1869618743997]
  #-A INPUT -s 88.88.88.88 -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT
  -A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT
  COMMIT
  # Completed on Tue Mar 25 10:57:08 2014
  </code></pre>
  
  <p>When I try to telnet to the linux server with mysql on (99.99.99.99) on port 3306 it times out, this happens on the windows server (88.88.88.88) and also from my local office PC.</p>
  
  <p>On the windows server the contents of my db.php include (this is the server that is trying to connect to the linux mysql) looks like this:</p>
  
  <pre><code>&lt;?php
  session_start();
  $host = "99.99.99.99";
  $user = "designjazzsu";
  $password = "52dJ5rH6kL77hgd!";
  $db = "designjazzsetup";
  
  $mysqli = new mysqli($host, $user, $password, $db);
  if ($mysqli-&gt;connect_errno) {
      echo "Failed to connect to MySQL: (" . $mysqli-&gt;connect_errno . ") " . $mysqli-&gt;connect_error;
  }
  #echo $mysqli-&gt;host_info . "\n";
  
  $mysqli = new mysqli("99.99.99.99", $user, $password, $db, 3306);
  if ($mysqli-&gt;connect_errno) {
      echo "Failed to connect to MySQL: (" . $mysqli-&gt;connect_errno . ") " . $mysqli-&gt;connect_error;
  }
  
  #echo $mysqli-&gt;host_info . "\n";
  ?&gt;
  </code></pre>
  
  <p>I have spent over a day on this and am completely stuck.</p>
  
  <p>I have a database on the linux server that needs to be shared between both servers.</p>
  
  <p>Any help would be greatly appreciated guys.</p>
  
  <p>And thanks.</p>
  
  <p>Kind regards,
  Michael</p>