mysql 配置在“启动服务器”处停止

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26970454/
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 13:11:12  来源:igfitidea点击:

mysql configuration stops at "starting server"

mysqlwindowsinstallation

提问by Paras Grover

I was installing MySQL installer on my windows 8 machine. During the server configuration process, it gets stuck at "starting server" and doesn't move any further. The log for the same is :

我正在 Windows 8 机器上安装 MySQL 安装程序。在服务器配置过程中,它卡在“启动服务器”并且不再移动。相同的日志是:

Beginning configuration step: Stopping Server [if necessary]
Ended configuration step: Stopping Server [if necessary]

开始配置步骤:停止服务器 [如有必要]
结束配置步骤:停止服务器 [如有必要]

Beginning configuration step: Writing configuration file
Ended configuration step: Writing configuration file

开始配置步骤:编写配置文件
结束配置步骤:编写配置文件

Beginning configuration step: Updating firewall
Adding firewall rule for MYSQL56 on port 3306.
Successfully added firewall rule.
Ended configuration step: Updating firewall

开始配置步骤:更新防火墙
在端口 3306 上为 MYSQL56
添加防火墙规则。成功添加防火墙规则。
结束配置步骤:更新防火墙

Beginning configuration step: Adjusting Windows service [if necessary]
Attempting to grant Network Service require filesystem permissions.
Granted permissions.
Adding a new service
New service added
Ended configuration step: Adjusting Windows service [if necessary]

开始配置步骤:调整 Windows 服务 [如有必要]
尝试授予网络服务需要文件系统权限。
授予的权限。
添加新服务
增加了新的服务
端的配置步骤:调整Windows服务[必要时]

I have already tried the following:-
* Un-installed all the programs that were in any way related to MySQL.
* Deleted the MySQL folder from C:\Program Files.
* Cleared my registry.
and then re-installed the program, but all in vain.

我已经尝试了以下方法:-
* 卸载所有与 MySQL 相关的程序。
* 从 C:\Program Files 中删除 MySQL 文件夹。
* 清除了我的注册表。
然后重新安装了程序,但都是徒劳。

The link MySQL Installer Stuck on "Starting Service"also shows the same problem but the solution provided is not working for me.

该链接的“启动服务”的MySQL安装卡住也显示了同样的问题,但所提供的解决方案是不是为我工作。

回答by Nenad Bulatovic

Here is what I did:

这是我所做的:

  1. Installed it with mysql-installer-web-community-5.6.23.0.msi
  2. For my purposes I selected "Custom" install with MySQL servers 5.6.22 - X64 and MySQL Connectors -> Connector ODBC/5.3.4 - 64
  3. Next -> Execute -(ready to configure) -> Next
  4. Config type: Development machine, all defaults (TCP/IP, Port: 3306, Open firewall)
  5. Typed in MySQL Root Password
  6. MySQL user Accounts -> Add user (username, password, OK) -> Next
  7. Configure MySQL Server as a Windows Service (CHECKED)
  8. Windows Service Name: MySQL56 (default)
  9. Start the MySQL Serve at System Startup
  10. THIS IS CRUCIAL (BUG IS HERE): Run Service as... Standard System Account (CHECKED - but it will be disregarded and that is BUG)
  11. Next -> Execute, Installation hangs on Starting server, so wait for a while to time out (or don't, your choice). When Dialog (might be covered with other windows) popup with message "Configuration of MySQL Server is taking longer than expected..., here click OK (so to wait longer)
  12. Meanwhile go to Start -> Control Panel -> Administrative Tools -> Services -> find MySQL56, right click on it -> Properties -> select Log On Tab AND HERE IS BUG -> Although Local System Account was selected, Somehow "This account: Network Service (with some password) was selected -> Select Log on as: Local System Account, Allow service to interact with desktop -> Apply -> Go back on general tab
  13. On general tab click on "Start" button to start service and here it is! Service is started! Click on OK to close MySQL56 Properties dialog. Close Services dialog. Close Administrative tools. Close control panel.
  14. And by that time (while you were closing those dialogs) when you look at MySQl Installer Dialog all steps are finished and checked: Starting Server, Applying security... Creating user accounts.. Updating Start menu link
  15. Confirm with Finish -> Next -> Finish
  1. 用 mysql-installer-web-community-5.6.23.0.msi 安装它
  2. 出于我的目的,我选择了“自定义”安装 MySQL 服务器 5.6.22 - X64 和 MySQL 连接器 -> 连接器 ODBC/5.3.4 - 64
  3. 下一步 -> 执行 -(准备配置) -> 下一步
  4. 配置类型:开发机,全部默认(TCP/IP,端口:3306,打开防火墙)
  5. 输入 MySQL Root 密码
  6. MySQL 用户帐户 -> 添加用户(用户名、密码、确定) -> 下一步
  7. 将 MySQL 服务器配置为 Windows 服务(已检查)
  8. Windows 服务名称:MySQL56(默认)
  9. 在系统启动时启动 MySQL 服务
  10. 这很重要(错误在这里):将服务作为...标准系统帐户运行(已检查 - 但它将被忽略,这是错误)
  11. 下一步 -> 执行,安装挂在启动服务器上,所以等待一段时间超时(或者不,你的选择)。当对话框(可能被其他窗口覆盖)弹出消息“MySQL 服务器的配置时间比预期的要长......,在这里单击确定(以便等待更长时间)
  12. 同时转到开始 -> 控制面板 -> 管理工具 -> 服务 -> 找到 MySQL56,右键单击它 -> 属性 -> 选择登录选项卡,这是错误 -> 虽然选择了本地系统帐户,但不知何故“这个帐户:选择网络服务(带有一些密码) -> 选择登录为:本地系统帐户,允许服务与桌面交互 -> 应用 -> 返回常规选项卡
  13. 在常规选项卡上单击“开始”按钮以启动服务,就在这里!服务开始了!单击确定关闭 MySQL56 属性对话框。关闭服务对话框。关闭管理工具。关闭控制面板。
  14. 到那时(当您关闭这些对话框时),当您查看 MySQl 安装程序对话框时,所有步骤都已完成并检查:启动服务器、应用安全性...创建用户帐户...更新开始菜单链接
  15. 确认完成 -> 下一步 -> 完成

That's it, happy MySQL-ing :)

就是这样,快乐的 MySQL ing :)

回答by Paras Grover

The installer has another issue that I discovered today.

安装程序还有我今天发现的另一个问题。

I had the same issue of the installer hanging on "Starting Server". However, after looking at the windows Event Viewer under Windows Logs -> Application, I discovered the error

我有同样的安装程序挂在“启动服务器”上的问题。但是,在查看Windows Logs -> Application下的windows Event Viewer后,我发现了错误

"Too many arguments (first extra is 'Something').For more information, see Help and Support Center at http://www.mysql.com.".

“参数太多(第一个额外的是'Something')。有关更多信息,请参阅http://www.mysql.com 上的帮助和支持中心。”。

The issue is that the installer cannot handle spaces in the windows service name (the name I used was Something MySQL). Simply change the name to one without spaces.

问题是安装程序无法处理 Windows 服务名称中的空格(我使用的名称是Something MySQL)。只需将名称更改为不带空格的名称即可。

回答by CraftsmanWannaBe

My issue was the special character in the password.

我的问题是密码中的特殊字符。

What I did to resolve being stuck at the Attempting to Start Server:
1. Use the installer to uninstall the previous version/installation
2. Validate and delete the existing MySQL Folders (DATA and App)
3. Re-install using the installer
4. Use a strong lengthy password with no special character password

我做了什么来解决卡在尝试启动服务器上的问题:
1. 使用安装程序卸载以前的版本/安装
2. 验证并删除现有的 MySQL 文件夹(数据和应用程序)
3. 使用安装程序重新安装
4.使用没有特殊字符密码的强而冗长的密码

回答by CalcGuy

I had the same problem where it changed from Local System Account to Network Service, I changed it in the services back to Local System Account. This however did not work. I came across another forum that suggested having spaces in the services name was causing the problem so I took out the spaces and put underscores and sure enough it worked!

我遇到了同样的问题,它从本地系统帐户更改为网络服务,我在服务中将其更改回本地系统帐户。然而这并没有奏效。我遇到了另一个论坛,该论坛建议在服务名称中有空格导致问题,所以我取出空格并加上下划线,果然它起作用了!

Change spaces to underscores!

将空格更改为下划线!

回答by Emagine

The MySQL developers insist that running the MySQL service Logged On as NETWORK SERVICE IS the proper way to do it and that running it as LOCAL SYSTEM opens security holes. Okay, people, the root of the problem here is that NETWORK SERVICE can't access the locations where the log files are configured to be. I suspect this error occurs when a folder is specified (by clicking Browse) that the NETWORK SERVICE doesn't have access to. In my case, I specified the log files to be written under My Documents in a folder called MySQL Logs. So, (and this can be done while the installer dialog is open, it says the installer is taking a long time, and prompting you to Wait or Cancel,):

MySQL 开发人员坚持以 NETWORK SERVICE 身份运行 MySQL 服务是正确的做法,而以 LOCAL SYSTEM 身份运行它会打开安全漏洞。好的,人们,这里问题的根源在于 NETWORK SERVICE 无法访问日志文件配置所在的位置。我怀疑当指定了网络服务无权访问的文件夹(通过单击浏览)时会发生此错误。就我而言,我指定了要在名为 MySQL Logs 的文件夹中的 My Documents 下写入的日志文件。所以,(这可以在安装程序对话框打开时完成,它说安装程序需要很长时间,并提示您等待或取消,):

I simply granted full control of that folder to the NETWORK SERVICE by right-clicking on the folder, selecting Properties, selecting Security, then clicking Add, then typing in "NETWORK SERVICE". Then I selected NETWORK SERVICE and clicked the checkboxes Allow for Full control and Modify.

我只是通过右键单击该文件夹,选择“属性”,选择“安全”,然后单击“添加”,然后输入“网络服务”,将对该文件夹的完全控制权授予 NETWORK SERVICE。然后我选择了网络服务并单击了允许完全控制和修改复选框。

回答by Richard France

Adding this for others.

为其他人添加这个。

I had install set up to configure windows service.

我已经安装设置来配置 Windows 服务。

Looking in Windows Event Viewer => Windows Logs => Application I found:

查看 Windows 事件查看器 => Windows 日志 => 应用程序我发现:

C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld.exe: Error while setting value '0.0' to 'lower_case_table_names'

C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld.exe:将值“0.0”设置为“lower_case_table_names”时出错

Checking the init file in C:\ProgramData\MySQL\MySQL Server 5.6\my.ini

检查C:\ProgramData\MySQL\MySQL Server 5.6\my.ini 中的 init 文件

I found:

我发现:

# Specifies the on how table names are stored in the metadata.
# If set to 0, will throw an error on case-insensitive operative systems
# If set to 1, table names are stored in lowercase on disk and comparisons are not case sensitive.
# If set to 2, table names are stored as given but compared in lowercase.
# This option also applies to database names and table aliases.
lower_case_table_names=0.0

I changed the value to 0, but on reinstall it reappeared as 0.0 so during the install and whilst the installation hanged at 'Starting Server' I edited the my.ini file, saved it, opened the services viewer and manually started the service MySql56. The installation then completed

我将值更改为 0,但在重新安装时它重新出现为 0.0,因此在安装过程中,当安装挂在“启动服务器”时,我编辑了 my.ini 文件,保存它,打开服务查看器并手动启动服务 MySql56。然后安装完成

回答by giridhar

I faced the same problem. Completely removing MySql from my PC and then installing it from scratch fixed my problem.

我遇到了同样的问题。从我的 PC 中完全删除 MySql,然后从头开始安装它解决了我的问题。

How to remove MySql Completely:

如何彻底删除MySql:

  1. Run Command Prompt as Administrator and execute the following command to stop and remove MySQL service.

    Net stop MySQL
    Sc delete MySQL
    
  2. Go to Control Panel >> Programs >> Programs and Features, select MySQL Server 5.x and click Uninstall. (If you can uninstall MySQL from Control Panel)

  3. Open Windows Explorer and go to Organize > Folder and search options, Select the “View” tab and under “Hidden files and Folders” choose “Show hidden files and folders”. Now explore the following locations and delete following folders.

    • C:\Program Files\MySQL
    • C:\Program Files (x86)\MySQL
    • C:\ProgramData\MySQL

    And if this exists, delete it too:

    C:\Users\[User-Name]\AppData\Roaming\MySQL
    
  4. Restart your PC and reinstall MySQL. That's all!

  1. 以管理员身份运行命令提示符并执行以下命令以停止和删除 MySQL 服务。

    Net stop MySQL
    Sc delete MySQL
    
  2. 转至控制面板 >> 程序 >> 程序和功能,选择 MySQL Server 5.x 并单击卸载。(如果您可以从控制面板卸载 MySQL)

  3. 打开 Windows 资源管理器并转到“组织”>“文件夹和搜索选项”,选择“查看”选项卡,然后在“隐藏的文件和文件夹”下选择“显示隐藏的文件和文件夹”。现在探索以下位置并删除以下文件夹。

    • C:\程序文件\MySQL
    • C:\Program Files (x86)\MySQL
    • C:\ProgramData\MySQL

    如果存在,也将其删除:

    C:\Users\[User-Name]\AppData\Roaming\MySQL
    
  4. 重新启动您的 PC 并重新安装 MySQL。就这样!

回答by Mukus

I've figured this one out. Mine was getting stuck at "Starting Server" too and Event Viewer had this -

我已经想通了这一点。我的也卡在“启动服务器”上,事件查看器有这个 -

The description for Event ID 100 from source MySQL cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.    
If the event originated on another computer, the display information had to be saved with the event.    
The following information was included with the event:     
innobase_buffer_pool_size can't be over 4GB on 32-bit systems

So I figured out the problem was trying to start the 32-bit version of MySQL that comes bundled in with the installer on a 64-bit machine could have been the problem. Although, MySQL states it will install 64-bit of the database.

所以我发现问题是试图启动与 64 位机器上的安装程序捆绑在一起的 32 位版本的 MySQL 可能是问题所在。虽然,MySQL 声明它将安装 64 位数据库。

What I did was downloaded a 64-bit zipped version and unpackaged it into a temporary location. I re-ranthe installer and let it install mysql. I replaced the contents of that with the other version from the temporary location without stopping the installer. Then I continued with configuration steps of the installer. It managed to start the service.

我所做的是下载一个 64 位压缩版本并将其解压缩到一个临时位置。我重新运行安装程序并让它安装 mysql。我在没有停止安装程序的情况下用临时位置的其他版本替换了其中的内容。然后我继续安装程序的配置步骤。它设法启动了服务。

Here's full trace of the log.

这是日志的完整跟踪。

Beginning configuration step: Stopping Server [if necessary]
Ended configuration step: Stopping Server [if necessary]

Beginning configuration step: Writing configuration file
Ended configuration step: Writing configuration file

Beginning configuration step: Updating firewall
Adding firewall rule for MySQL56 on port 3306.
Successfully added firewall rule.
Ended configuration step: Updating firewall

Beginning configuration step: Adjusting Windows service [if necessary]
Attempting to grant Network Service require filesystem permissions.
Granted permissions.
Adding new service
New service added
Ended configuration step: Adjusting Windows service [if necessary]

Beginning configuration step: Starting Server
Starting MySQL as a service
Ended configuration step: Starting Server

Beginning configuration step: Applying security settings
Attempting to update security settings.
Updated security settings.
Ended configuration step: Applying security settings

Beginning configuration step: Creating user accounts
Attempting to Add New MySQL Users
Added New Users.
Ended configuration step: Creating user accounts

Beginning configuration step: Updating Start Menu Link
Attempting to verify command-line client shortcut.
Verified command-line client shortcut.
Verified command-line client shortcut.
Ended configuration step: Updating Start Menu Link

mysql site

mysql 站点

回答by SteveCinq

This seems to be a chronic issue with MySQL Installer even now (v1.4.17.0). No matter what, every timeI (re-)configure an instance on Windows 7 Pro or Server (2008 R2) it hangs at this point.

即使现在(v1.4.17.0),这似乎也是 MySQL Installer 的一个长期问题。无论如何,每次我(重新)配置 Windows 7 Pro 或 Server (2008 R2) 上的实例时,它都会在此时挂起。

Simplest fix is:

最简单的修复是:

  1. When the installer hangs, open Windows Services and locate your mySQL service instance(s).
  2. Double-click to open the/an instance and set Log on as:to Local System accountand check Allow service to interact with desktop.
  3. Optionally but preferably set the Recovery options to allow the service to resume after a problem.
  4. Ensure that Startup type is set to Automatic(or whatever your preference is).
  5. Click Applyand then click Start (or click OKand then start the service).
  6. Return to the MySQL Installerand close any open warning about waiting for the process to complete and the process should continue.
  7. Repeat as required for each MySQL Server instance.
  1. 当安装程序挂起时,打开 Windows 服务并找到您的 mySQL 服务实例。
  2. 双击打开/实例并将登录为:设置为本地系统帐户并选中允许服务与桌面交互
  3. 可选但最好设置恢复选项以允许服务在出现问题后恢复。
  4. 确保启动类型设置为自动(或任何您的偏好)。
  5. 单击应用,然后单击启动(或单击确定,然后启动服务)。
  6. 返回MySQL 安装程序并关闭有关等待进程完成的所有打开警告,进程应继续。
  7. 根据需要对每个 MySQL 服务器实例重复。

Note: The installer seems to not enable the firewall exception that you may have selected when MySQL Server was first configured, so you may have to reconfigure again to open the firewall.

注意:安装程序似乎没有启用您在第一次配置 MySQL 服务器时可能选择的防火墙例外,因此您可能需要再次重新配置以打开防火墙。

Side note: All-in-all, I'd have to say that after only two days of using the MySQL ecosystem, I'm less than impressed by how buggy things are. I would estimate that I had to set up two server interfaces about 6 times before everything worked as advertised. Workbench crashed on me 5+ times in the first day alone and I've had to traipse through any number of forums finding answers to stuff like this. Be prepared to do the same.

旁注:总而言之,我不得不说,在使用 MySQL 生态系统仅两天后,我对事情的错误印象并不深刻。我估计我必须设置两个服务器接口大约 6 次,然后一切都按宣传的那样工作。仅在第一天,Workbench 就对我崩溃了 5 次以上,我不得不在许多论坛中四处游荡,寻找此类问题的答案。准备做同样的事情。

回答by John Bentley

I made this problem disappear by upgrading from 5.7 to 8.0.

我通过从 5.7 升级到 8.0 使这个问题消失了。

Specifically I:

具体我: