hi everyone,
sorry if this is posted in the wrong forum, but it’s kinda a php and mysql issue. I have a mysql database on a remote server. I setup my servers and mysql users to be able to connect remotely. it worked great until a few days ago when it stopped working and started throwing me an error:
[CODE]
Could not connect: Can’t connect to MySQL server on ‘XXX.XX.XXX.03’ (13)
database server IP ends in .03
websites server ends in .02
so what is really interesting is I can still log into the database from the remote server ie:
[CODE]
## from the remote .02 server ##
mysql -h XXX.XX.XXX.03 -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 74
Server version: 5.0.77 Source distribution
Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the buffer.
mysql>
what is even more interesting is that the script that is giving me the error above can be run from the command line with no problems on the remote (.02) server. script below:
[code=php]
$link = mysql_connect(‘XXX.XX.XXX.03’, ‘root’, ‘MYPASSWORD’);
if (!$link) {
die(‘Could not connect: ‘ . mysql_error());
}
echo ‘Connected successfully’;
mysql_close($link);
so basically if I hit the above code with a browser I get this error: Could not connect: Can’t connect to MySQL server on ‘XXX.XX.XXX.03’ (13)
but if I log into the remote .02 server and enter:
[CODE]
php /var/www/html/test.php
# i get:
Connected successfully
very strange I’m thinking permissions issue but I don’t really know. any help would be appreciated. – thanks.