How to check if MySQL server already running

Hi,
Starting my application I need to use mysqld to launch the MySQL server.

So I need to know whether the server is already running or not in order to prevent error:

«Do you already have another mysqld server running on port: 3306 ?»

Thanks

scml
scmlAsked:
Who is Participating?
 
iHadiConnect With a Mentor Commented:
Hi scml

The following link leads to a question very simular to yours:
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21933668.html
0
 
newyuppieCommented:
you could use Try..Catch blocks

Try
   MyConnection.Open
Catch ex as MySQLException
   'server was open, procced with other code
End Try
0
All Courses

From novice to tech pro — start learning today.