我正在尝试同时安装了工作台(gui)的MySQL(Windows 8)。
我仍在安装/配置过程中。我想创建一个新的数据库。因此,在工作台的欢迎屏幕上,我选择了New Server Instance- Register a new Server instance to manage
。
为了做到这一点,我经历了以下配置步骤:
localhost
作为服务器主机然后测试数据库连接,并在下一步中要求我执行以下操作:
但是,可能的服务列表为空,如果我单击[next],则说
我认为我必须以某种方式启动MySQL服务,因为在安装整个MySQL Toolset时可能已经安装了它。
因此:我将如何在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 Successfully installed
消息。注意:即使您已经以Windows 7/8管理员身份登录。
如果您想卸载该服务,请执行以下操作,然后将以下内容复制并粘贴到命令提示符中(再次使用提升的命令提示符):
sc delete MySQL
该命令中的
MySQL
是mysql默认在Windows PC中创建的服务名称。确保在服务列表(任务管理器->服务选项卡->检查Mysql服务名称列)中看到该服务已安装。