Mysql 服务缺失

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5679258/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 19:31:26  来源:igfitidea点击:

Mysql service is missing

mysqlservice

提问by Igal

I have installed Mysql server locally and everything was working Ok but today when I tried to get a connection to the local db, I got an error. After checking services showed that the MySql service is missing...

我已经在本地安装了 Mysql 服务器,一切正常,但是今天当我尝试连接到本地数据库时,出现错误。检查服务后显示缺少MySql服务...

What can the problem be?

问题是什么?

Thanks in advance for any helps

在此先感谢您的帮助

回答by Atish Dipongkor - MVP

I have done it by the following way

我通过以下方式做到了

  1. Start cmd
  2. Go to the "C:\Program Files\MySQL\MySQL Server 5.6\bin"
  3. type mysqld --install
  1. 启动命令
  2. 转到“C:\Program Files\MySQL\MySQL Server 5.6\bin”
  3. 输入 mysqld --install

Like the following image. Seefor more information.

像下图。有关更多信息,请参阅

enter image description here

在此处输入图片说明

回答by NickSoft

Go to your mysql bin directory and install mysql service again:

转到您的 mysql bin 目录并再次安装 mysql 服务:

c:
cd \mysql\bin
mysqld-nt.exe --install

or if mysqld-nt.exe is missing (depending on version):

或者如果缺少 mysqld-nt.exe(取决于版本):

mysqld.exe --install

Then go to services, start the service and set it to automatic start.

然后进入服务,启动服务并设置为自动启动。

回答by kavi temre

I also face the same problem. do the simple steps

我也面临同样的问题。做简单的步骤

  1. Go to bin directory copy the path and set it as a environment variable.
  2. Run the command prompt as admin and cd to bin directory:
  3. Run command : mysqld –install
  4. Now the services are successfully installed
  5. Start the service in service windows of os
  6. Type mysql and go
  1. 转到 bin 目录复制路径并将其设置为环境变量。
  2. 以管理员身份运行命令提示符并 cd 到 bin 目录:
  3. 运行命令:mysqld –install
  4. 现在服务安装成功
  5. 在os的服务窗口启动服务
  6. 输入 mysql 并开始

回答by Jappie Kerk

If you wish to have your config file on a different path you haveto give your service a name:

如果您希望将配置文件放在不同的路径上,则必须为您的服务命名:

mysqld --install NAME --defaults-file=C:\my-opts2.cnf

You can also use the name to install multiplemysql services listening on different sockets if you need that for some reason. You can see why it's failing by copying the execution path and adding --console to the end in the terminal. Finally, you can modify the starting path of a service by regediting:

如果出于某种原因需要,您还可以使用该名称安装多个mysql 服务,这些服务侦听不同的套接字。您可以通过复制执行路径并将 --console 添加到终端的末尾来了解它失败的原因。最后,您可以通过regediting来修改服务的起始路径:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NAME

That works well but it isn't as useful because the windows service mechanism provides little logging capabilities.

这很有效,但没有那么有用,因为 Windows 服务机制提供的日志记录功能很少。

回答by Vighnu

Go to

C:\Program Files\MySQL\MySQL Server 5.2\bin

C:\Program Files\MySQL\MySQL Server 5.2\bin

then Open MySQLInstanceConfig file

然后打开 MySQLInstanceConfig 文件

then complete the wizard.

然后完成向导。

Click finish

点击完成

Solve the problem

解决这个问题

I think this is the best way to change the port number also.

我认为这也是更改端口号的最佳方法。

It works for me

这个对我有用

回答by MAC

I came across the same problem. I properly installed the MYSQL Workbench 6.x, but faced the connection as below:

我遇到了同样的问题。我正确安装了 MYSQL Workbench 6.x,但遇到如下连接:

enter image description here

在此处输入图片说明

I did a bit R&D on this and found that MySQL service in service.msc is not present. To achieve this I created a new connection in MySQL Workbench then manually configured the MySQL Database Server in "System Profile" (see the below picture).

我对此做了一些研究,发现 service.msc 中的 MySQL 服务不存在。为此,我在 MySQL Workbench 中创建了一个新连接,然后在“系统配置文件”中手动配置了 MySQL 数据库服务器(见下图)。

You also need to install MySQL Database Server and set a configuration file path for my.ini. Now at last test the connection (make sure MySQL service is running in services.msc).

您还需要安装 MySQL 数据库服务器并为my.ini. 现在最后测试连接(确保 MySQL 服务在 services.msc 中运行)。

enter image description here

在此处输入图片说明