gpt4 book ai didi

mysql - 将 MySQL 服务器作为服务启动 (Win 8)

转载 作者:IT王子 更新时间:2023-10-28 23:45:19 26 4
gpt4 key购买 nike

我正在试用 MySQL (Windows 8),同时安装了工作台 (gui)。

我仍在安装/配置过程中。我想创建一个新的数据库。因此,在工作台的欢迎屏幕上,我选择了 New Server Instance- Register a new Server instance to manage

为了做到这一点,我完成了以下配置步骤:

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

  2. 给它我正在使用的用户名和密码。

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

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

但是,可能的服务列表是空的,如果我单击 [下一步],它会显示

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.

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

那么:如何在 Windows 8 下启动这个 MySQL 服务?

我尝试过的一些事情:

Manual说试试:

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

为了将其安装为服务。然而,没有任何反应,我得到以下信息(删除了一些冗长的 [Note]):

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

为了将服务器安装为服务,我使用了这个命令 ( per the manual )。

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

同样,“什么都没有”发生,我得到(同样,大部分冗长的 [Note] 已被删除):

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

最佳答案

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

然后将以下文本粘贴到您的命令提示符中,

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

如果您不以管理员身份运行 cmd,您将看到 Install/Remove of service denied.

因此运行提升的命令提示符(开始->cmd->以管理员身份运行)以查看服务已成功安装消息。

Service Denied Screenshot

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

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

sc 删除 MySQL

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

Service delete command prompt screenshot

关于mysql - 将 MySQL 服务器作为服务启动 (Win 8),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15993089/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com