I need to check whether mysql is running or no on a given host.
For example, if a user gives 100pulse.com as a host then i’ve check the 100pulse.com server and output whether mysql in that server is offline or online. Is there any functions?
Any help greatly appreciated, Thanks.
@Arthur Halma answer: This is valid only if the server allows for remote (non-filtered) mysql connections and is hosted on the same server as apache. This can return “Unknown MySQL server…” if there is no external connection or firewall filtered connection.
Ultimately there is no sure way to check if a database is running unless you have permissions and the host information and ports. Even with a server that is under a Denial of Service (DoS) attack of MySQL, that will stop dynamic websites from loading, will not cause an unknown MySQL. Most companies filter their traffic by ip address to their MySQL server to stop potential DoS attacks.
Not to mention not all companies use MySQL. There is Oracle, DB2, Informix, Ingres, Microsoft SQL Server, and PostgreSQL. And you would have to implement something to check which one they are using is working.