That's quite easy i guess, You can just connect the normal way to MySql Database within a
try...catch block and see if it fails or not!
here is a simple method i developed:
public bool CheckMySqlConnection(string ConnectionString)
bool failed = false;
MySqlConnection conx = null;
using (conx = new MySqlConnection(ConnectionString))
/* If we reached here, that means the connection to the database was successful. */
catch (Exception ex)
// We are here that means the connection failed!
// You can handle the exception differently if you want to provide richer error handling.
// At this moment we just return "false" which means the connection failed.
Notice: that i used the using block, to make sure that the Connection is closed & disposed once done with it!