I have an apache web server running PHP. I am trying to make a connection from apache server to a database server running mysql server. Heres a run down of the settings in place.
- apache server: RHEL 5.5; PHP 5.3.2
- database server: Ubuntu 10.04 64bit; mysql server version 5.1
- There are no firewall rules restricting connections between these two machines. neither in our hardware firewall or in iptables.
- /etc/mysql/my.cnf has the bind-address set to the machine's ip.
- skip-networking is commented out, ie disabled.
- mysql is running and on the standard port 3306
- /var/run/mysqld/mysqld.sock is owned by mysql
- i can connect to mysql locally
the following is my php connection script:
<?php
$host="555.555.55.55";
$user="some_user";
$pass="some_pass";
$conn = mysql_connect($host, $user, $pass);
if ($conn === FALSE) { echo mysql_error(); }
else { echo 'Connected'; mysql_close($conn); }
?>
attempting to execute the php script in a browser hosted on the apache server only yields: "Could not connect: Can't connect to MySQL server on '555.555.55.55' (4)"
any suggestions? Thanks.