如何更改mysql服务的路径 [英] How to change the path of mysql services
问题描述
在安装MySQL 5.1.73之后,我将path变量添加到
After installation of MySQL 5.1.73, I've added the path variable to
C:\Program Files\MySQL\MySQL Server 5.1\bin
然后我在命令行中尝试了
And I tried in the command line:
"C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --install
它显示:
The service already exists!
The current server installed: "c:\Program Files\MySQL\mysqld" --defaults-file=my.ini MySQL
但是正如您所看到的,我设置的路径是"C:\ Program Files \ MySQL \ MySQL Server 5.1 \ bin \ mysqld",而不是"c:\ Program Files \ MySQL \ mysqld",所以当我键入以下内容时,毫无疑问:
But as you can see the path I set is "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" but not "c:\Program Files\MySQL\mysqld" So no doubt when I type:
net start mysql
我得到:
System error 2 has occurred.
The system cannot find the file specified.
如何更改奇怪的错误目录?我从来没有设置过这个错误的目录.我的平台是Windows 7企业版
How to change the strange wrong directory? I've never set this wrong directory before. My platform is Windows 7 Enterprise
推荐答案
打开注册表编辑器(regedit.exe),然后找到mysql服务(HKLM --> SYSTEM --> CurrentControlSet --> Services --> MySQL)
并更正ImagePath设置.
Open registry editör (regedit.exe) then find mysql service (HKLM --> SYSTEM --> CurrentControlSet --> Services --> MySQL)
and correct the ImagePath setting.
在Windows 10 {Computer \ HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ MySQL}中的regedit中更新MySQL的路径
Updating the path to MySQL in regedit in Windows 10 {Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySQL}
或者,您可以在注册表中搜索<c1>并更改为C:\Program Files\MySQL\MySQL Server 5.1\bin
Alternatively you can search for c:\Program Files\MySQL\mysqld
in registry and change to C:\Program Files\MySQL\MySQL Server 5.1\bin
然后以cmd(管理员模式)运行
Then run in cmd (admin mode)
- cd C:\ Program Files \ MySQL \ MySQL Server 5.1 \ bin
- mysqld.exe-初始化
- 打开服务并启动mysql服务或 运行:net start mysql
- cd C:\Program Files\MySQL\MySQL Server 5.1\bin
- mysqld.exe --initialize
- open services and start mysql service OR run: net start mysql
这篇关于如何更改mysql服务的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!