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)

  1. cd C:\Program Files\MySQL\MySQL Server 5.1\bin
  2. mysqld.exe --initialize
  3. 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

  1. Run "regedit.exe" from start button.
  2. From within "Registry Editor" Edit --> Find (Ctrl + F)
  3. Use "mysql" as the "search key"
  4. Now, you would find the following window

enter image description here

  1. Right click [ImagePath] icon and choose "Modify".
  2. 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.

Tags:

Windows

Mysql