Script to start / stop mysql in Windows 7

For users or potential users.
Post Reply
drtmz
Posts: 84
Joined: Thu May 29, 2008 4:27 pm

Script to start / stop mysql in Windows 7

Post by drtmz » Sat Dec 10, 2011 2:55 am

To my fellow gearheads out there I need a script to start and stop mysql in Windows 7.

In Windows XP Pro 'net stop mysql' and 'net start mysql' worked nicely.
But you have to run it as an administrator in Windows 7.
'Net stop mysqladmin' and 'net start mysqladmin' don't seem to work.

I am looking to setup a bat file to automate stopping and starting mysql in Windows 7 for restoring to my home computer.
Any help would be appreciated.

Thanks,
drtmz

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Script to start / stop mysql in Windows 7

Post by jordansparks » Sat Dec 10, 2011 7:52 am

I can't think of a way to get around running it as admin. But that's not so bad. I personally handle it with shortcuts to the bat, setting the properties on the shortcut to always run as admin. I also suspect that you can specify a Windows user as part of the net start... command. At least you can do things like that from in C#, so I assume there's support for that in the bat command interpreter. The mysql website or forum might also have some suggestions.
Jordan Sparks, DMD
http://www.opendental.com

Post Reply