如何更改mysql服务的路径 [英] How to change the path of mysql services

查看:667
本文介绍了如何更改mysql服务的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在安装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)

  1. cd C:\ Program Files \ MySQL \ MySQL Server 5.1 \ bin
  2. mysqld.exe-初始化
  3. 打开服务并启动mysql服务或 运行:net start mysql
  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

这篇关于如何更改mysql服务的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆