Hello Does anybody know, how I can test, if the MySQL server is available (online) before connecting to it?
Thanks Sam
There's only one way to see if a mysql server will respond to your connect request, and that is by sendin a connect-request...
When I try to connect to a MySQL server which is down, the script hangs. Is there a possibility to set a timeout or something like this?
It just hangs? that's odd.
Anyway, you could try to use fsockopen, that has a 'timeout' parameter. You could set it up to connect to the mysql server on the mysql port, and see if MySQL let's you connect.
Thanks I'll give this a try