How to change the path of mysql services
Open registry editör (regedit.exe) then find mysql service (HKLM --> SYSTEM --> CurrentControlSet --> Services --> MySQL)
and correct the ImagePath setting.
Updating the path to MySQL in regedit in Windows 10 {Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySQL}
Alternatively you can search for c:\Program Files\MySQL\mysqld
in registry and change to C:\Program Files\MySQL\MySQL Server 5.1\bin
Then run in cmd (admin mode)
- cd C:\Program Files\MySQL\MySQL Server 5.1\bin
- mysqld.exe --initialize
- open services and start mysql service OR run: net start mysql
This error may happen as you install Window recently and didn't to any updates of something. What I took is as follows
- Run "regedit.exe" from start button.
- From within "Registry Editor" Edit --> Find (Ctrl + F)
- Use "mysql" as the "search key"
- Now, you would find the following window
- Right click [ImagePath] icon and choose "Modify".
- Enter your 'mysqld.exe' full pathname there as shown in the above image.
After I did above procedure, no "System error 2" occurred when I execute following command.
DOS> net start mysql
Good luck.