启动MySQL服务器作为服务(Win 8) [英] Start MySQL Server as a service (Win 8)

查看:180
本文介绍了启动MySQL服务器作为服务(Win 8)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试MySQL(Windows 8),安装工作台(gui)。



我仍然在安装/配置过程中。我想创建一个新的数据库。因此,在工作台的欢迎屏幕上,我选择了新服务器实例 - 注册新的服务器实例以管理



为此,我已完成以下配置步骤:


  1. 指定 localhost 作为服务器主机,


  2. 提供我使用的用户名和密码


然后测试数据库连接,并在下一步中要求我


从下面的列表中选择要管理的服务。
它还将帮助查找配置文件。


但是,可能的服务列表为空,如果我点击[下一步],它说


错误:为了管理MySQL服务, 。向导在目标计算机上找不到任何MySQL服务,因此无法启动服务器实例。


我认为我必须以某种方式启动MySQL服务,因为它可能已经安装时,我已经安装了整个MySQL工具集。



所以:我如何在Windows 8下启动这个MySQL服务?



我尝试过的一些操作:



手动说要尝试:

  C:\> C:\Program Files\MySQL\MySQL Server 5.1\bin \mysqld

以便将其作为服务安装。然而,没有发生任何事情,我得到以下(一些详细[注]被删除):

  2013-04-13 23 :44:22 0 [警告]具有隐式DEFAULT值的TIMESTAMP为depreca 
ted。请使用--explicit_defaults_for_timestamp服务器选项(有关详细信息,请参阅documentati
on)。
2013-04-13 23:44:22 2592 [警告]无法创建测试文件c:\Program Files\MySQL
\MySQL Server 5.6\data\gast.lower -test
2013-04-13 23:44:22 2592 [Warning]无法创建测试文件c:\Program Files\MySQL
\MySQL Server 5.6\data\gast .lower-test
[...]
2013-04-13 23:44:22 2592 [错误] InnoDB:无法在.\ibdata1模式下打开
2013 -04-13 23:44:22 2592 [错误] InnoDB:系统表空间必须可写!

2013-04-13 23:44:22 2592 [ERROR]插件'InnoDB'init函数返回错误。
2013-04-13 23:44:22 2592 [ERROR]插件'InnoDB'注册为STORAGE ENGIN
E失败。
2013-04-13 23:44:22 2592 [错误]未知/不受支持的存储引擎:InnoDB
2013-04-13 23:44:22 2592 [错误]中止

2013-04-13 23:44:22 2592 [Note] Binlog end
[...]
2013-04-13 23:44:22 2592 [Note] mysqld:Shutdown complete

要将服务器作为服务安装,我使用了此命令(根据手册)。

  C:\> C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld--install 

再次,没有发生,我得到(再次,大部分详细的[注]被删除):

 安装/删除服务被拒绝! 

c:\Program Files\MySQL\MySQL Server 5.6\bin> mysqld -p --install
2013-04-13 23:43:24 0 [Warning] TIMESTAMP与隐含DEFAULT值是depreca
ted。请使用--explicit_defaults_for_timestamp服务器选项(有关详细信息,请参阅documentati
on)。
2013-04-13 23:43:24 3764 [Warning]无法创建测试文件c:\Program Files\MySQL
\MySQL Server 5.6\data\gast.lower -test
2013-04-13 23:43:24 3764 [Warning]无法创建测试文件c:\Program Files\MySQL
\MySQL Server 5.6\data\gast .lower-test
[...]
2013-04-13 23:43:24 3764 [错误] InnoDB:无法在.\ibdata1模式下打开
2013 -04-13 23:43:24 3764 [错误] InnoDB:系统表空间必须可写!

2013-04-13 23:43:24 3764 [ERROR]插件'InnoDB'init函数返回错误。
2013-04-13 23:43:24 3764 [错误]插件'InnoDB'注册为STORAGE ENGIN
E失败。
2013-04-13 23:43:24 3764 [错误] mysqld:未知选项'-p'
2013-04-13 23:43:24 3764 [错误]中止

2013-04-13 23:43:24 3764 [注意] Binlog结束
[...]
2013-04-13 23:43:24 3764 [注意] mysqld:关闭完成


解决方案

在开始时键入cmd,然后右键单击并以管理员身份运行,



然后在命令提示符中粘贴以下文本:

  C:\Program Files(x86)\MySQL\MySQL Server 5.1\bin\mysqld--install 

如果您不以管理员身份运行cmd,则会看到安装/删除服务被拒绝。



因此,请运行提升的命令提示符(Start-> cmd-> Run as Administrator)以查看服务成功安装消息。





:即使您以管理员身份在Windows 7/8中登录也是如此。

如果要卸载该服务,请执行以下操作,复制粘贴以下命令提示符(再次提升命令提示符)运行此



sc删除MySQL



在此命令中的 MySQL 是默认创建的服务名称在Windows PC。确保您看到服务已安装在服务列表中(任务管理器 - >服务选项卡 - >检查Mysql服务名称列)。




I am trying out MySQL (Windows 8), with the workbench (gui) installed as well.

I am still in the installation / configuration process. I would like to create a new database. So, on the workbench's welcome screen, I have selected New Server Instance- Register a new Server instance to manage.

In order to do this, I have went through following configuration steps:

  1. Specify localhost as server host,

  2. Give it the username and password I am using.

It then tests a database connection, and, in the next step, asks me to

Select the Service to manage from the list below. It will also help find the configuration file.

However, the list of possible Services is empty and if I click [next], it says

Error: In Order to manage a MySQL Service it must be installed as a Service. The wizard can not find any MySQL Service at the target machine, so the Server instance cannot be started.

I think that I have to somehow start the MySQL Service, as it might already been installed when I had installed the whole MySQL Toolset.

So: How would I start this MySQL Service under Windows 8?

Some things I've tried:

The Manual says to try:

C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld"

in order to install it as a Service. Yet, nothing happens and I get the following (some verbose [Note]s were removed):

2013-04-13 23:44:22 0 [Warning] TIMESTAMP with implicit DEFAULT value is depreca
ted. Please use --explicit_defaults_for_timestamp server option (see documentati
on for more details).
2013-04-13 23:44:22 2592 [Warning] Can't create test file c:\Program Files\MySQL
\MySQL Server 5.6\data\gast.lower-test
2013-04-13 23:44:22 2592 [Warning] Can't create test file c:\Program Files\MySQL
\MySQL Server 5.6\data\gast.lower-test
[...]
2013-04-13 23:44:22 2592 [ERROR] InnoDB: read can't be opened in .\ibdata1 mode
2013-04-13 23:44:22 2592 [ERROR] InnoDB: The system tablespace must be writable!

2013-04-13 23:44:22 2592 [ERROR] Plugin 'InnoDB' init function returned error.
2013-04-13 23:44:22 2592 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGIN
E failed.
2013-04-13 23:44:22 2592 [ERROR] Unknown/unsupported storage engine: InnoDB
2013-04-13 23:44:22 2592 [ERROR] Aborting

2013-04-13 23:44:22 2592 [Note] Binlog end
[...]
2013-04-13 23:44:22 2592 [Note] mysqld: Shutdown complete

To install the server as a service, I've used this command (per the manual).

C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --install

Again, "nothing" happens, I get (again, most of the verbose [Note]s are removed):

Install/Remove of the Service Denied!

c:\Program Files\MySQL\MySQL Server 5.6\bin>mysqld -p --install
2013-04-13 23:43:24 0 [Warning] TIMESTAMP with implicit DEFAULT value is depreca
ted. Please use --explicit_defaults_for_timestamp server option (see documentati
on for more details).
2013-04-13 23:43:24 3764 [Warning] Can't create test file c:\Program Files\MySQL
\MySQL Server 5.6\data\gast.lower-test
2013-04-13 23:43:24 3764 [Warning] Can't create test file c:\Program Files\MySQL
\MySQL Server 5.6\data\gast.lower-test
[...]
2013-04-13 23:43:24 3764 [ERROR] InnoDB: read can't be opened in .\ibdata1 mode
2013-04-13 23:43:24 3764 [ERROR] InnoDB: The system tablespace must be writable!

2013-04-13 23:43:24 3764 [ERROR] Plugin 'InnoDB' init function returned error.
2013-04-13 23:43:24 3764 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGIN
E failed.
2013-04-13 23:43:24 3764 [ERROR] mysqld: unknown option '-p'
2013-04-13 23:43:24 3764 [ERROR] Aborting

2013-04-13 23:43:24 3764 [Note] Binlog end
[...]
2013-04-13 23:43:24 3764 [Note] mysqld: Shutdown complete

解决方案

Type cmd in start and right click and Run as administrator,

then paste the below text in your command prompt,

"C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin\mysqld" --install

If you don't run cmd as Administrator, you'll see Install/Remove of service denied.,

So run the elevated command prompt(Start->cmd->Run as Administrator) to see the Service Successfully installed message.

Note: This is even if you have logged in as administrator in windows 7/8.

If u want to uninstall the service do the following, copy paste the following in command prompt(again elevated command prompt) run this,

sc delete MySQL

Here MySQL in the command is the service name mysql creates by default in Windows PC. Make sure you see the service is installed in the Services List(Task Manager -> Services Tab -> Check the Mysql service Name column).

这篇关于启动MySQL服务器作为服务(Win 8)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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