I am using XAMPP to run Apache, PHP and MySQL on a bunch of remote laptops for our clients. It is just the XAMPP directory with all the files (thumbdrive version, no registry values are added or modified). I have an install file that puts an icon on the user's desktop that runs start.bat from the XAMPP directory. Start.bat basically starts Apache, then MySQL, and then opens a browser to localhost. Everything works great, except that when the icon is clicked the second time, a second mysqld.exe service starts. Apache does not start twice if the icon is clicked twice, but MySQL does. I've tried several Google and Stack Overflow suggestions to check if a service is running and, if so, stop the service from starting again; however, none of those worked.
The batch file that starts MySQL basically has this one command:
mysql\bin\mysqld --defaults-file=mysql\bin\my.ini --standalone --console
How can I keep mysqld.exe from starting twice? Also, is it a big deal if it is running twice? Will that cause any problems when running a query from PHP?