I am trying to create a script to check the status of a mysql server on one of my sites by going through the port 3306..
Here's the code I have so far..
PHP Code:
$socket_connection = @fsockopen("whatever.com", 3306, $error_number, $error, 35);
fputs($socket_connection, '');
#RETRIEVE CONNECTION RESPONSE
if(!feof($socket_connection))
{
$connection_response = fgets($socket_connection, 4096);
}
fclose($socket_connection);
echo $connection_response;
My connections are fine after adding my source IP to the mysql's "whitelist".
I keep getting errors like:
s���ÿiHost 'host.blahblahblah.com' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
=���
Do you guys know what is a successful response from a mysql connection?
Bookmarks