简体   繁体   English

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

[英]mysql configuration stops at “starting server”

I was installing MySQL installer on my windows 8 machine.我正在 Windows 8 机器上安装 MySQL 安装程序。 During the server configuration process, it gets stuck at "starting server" and doesn't move any further.在服务器配置过程中,它卡在“启动服务器”并且不再移动。 The log for the same is :相同的日志是:

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.在端口 3306 上为 MYSQL56 添加防火墙规则。
Successfully added firewall rule.已成功添加防火墙规则。
Ended configuration step: Updating firewall结束配置步骤:更新防火墙

Beginning configuration step: Adjusting Windows service [if necessary]开始配置步骤:调整 Windows 服务 [如有必要]
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 服务 [如有必要]

I have already tried the following:-我已经尝试过以下方法:-
* Un-installed all the programs that were in any way related to MySQL. * 卸载所有与 MySQL 相关的程序。
* Deleted the MySQL folder from C:\\Program Files. * 从 C:\\Program Files 中删除 MySQL 文件夹。
* Cleared my registry. * 清除了我的注册表。
and then re-installed the program, but all in vain.然后重新安装了程序,但都是徒劳。

The link MySQL Installer Stuck on "Starting Service" also shows the same problem but the solution provided is not working for me. MySQL Installer Stuck on“Starting Service”链接也显示了同样的问题,但提供的解决方案对我不起作用。

Here is what I did:这是我所做的:

  1. Installed it with mysql-installer-web-community-5.6.23.0.msi用 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出于我的目的,我选择了“自定义”安装 MySQL 服务器 5.6.22 - X64 和 MySQL 连接器 -> 连接器 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)配置类型:开发机,全部默认(TCP/IP,端口:3306,打开防火墙)
  5. Typed in MySQL Root Password输入 MySQL Root 密码
  6. MySQL user Accounts -> Add user (username, password, OK) -> Next MySQL 用户帐户 -> 添加用户(用户名、密码、确定) -> 下一步
  7. Configure MySQL Server as a Windows Service (CHECKED)将 MySQL 服务器配置为 Windows 服务(已检查)
  8. Windows Service Name: MySQL56 (default) Windows 服务名称:MySQL56(默认)
  9. Start the MySQL Serve at System Startup在系统启动时启动 MySQL 服务
  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)当对话框(可能被其他窗口覆盖)弹出消息“MySQL 服务器的配置时间比预期的要长......,在这里单击确定(以便等待更长时间)
  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同时转到开始 -> 控制面板 -> 管理工具 -> 服务 -> 找到 MySQL56,右键单击它 -> 属性 -> 选择登录选项卡,这是错误 -> 虽然选择了本地系统帐户,但不知何故“这个帐户:选择网络服务(带有一些密码) -> 选择登录为:本地系统帐户,允许服务与桌面交互 -> 应用 -> 返回常规选项卡
  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.单击确定关闭 MySQL56 属性对话框。 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到那时(当您关闭这些对话框时),当您查看 MySQl 安装程序对话框时,所有步骤都已完成并检查:启动服务器,应用安全性...创建用户帐户...更新开始菜单链接
  15. Confirm with Finish -> Next -> Finish确认完成 -> 下一步 -> 完成

That's it, happy MySQL-ing :)就是这样,快乐的 MySQL ing :)

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).问题是安装程序无法处理 Windows 服务名称中的空格(我使用的名称是Something MySQL)。 Simply change the name to one without spaces.只需将名称更改为不带空格的名称即可。

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 1.使用安装程序卸载以前的版本/安装
2. Validate and delete the existing MySQL Folders (DATA and App) 2. 验证并删除现有的 MySQL 文件夹(DATA 和 App)
3. Re-install using the installer 3.使用安装程序重新安装
4. Use a strong lengthy password with no special character password 4. 使用无特殊字符密码的强长密码

This seems to be a chronic issue with MySQL Installer even now (v1.4.17.0).即使现在(v1.4.17.0),这似乎也是 MySQL Installer 的一个长期问题。 No matter what, every time I (re-)configure an instance on Windows 7 Pro or Server (2008 R2) it hangs at this point.无论如何,每次我(重新)配置 Windows 7 Pro 或 Server (2008 R2) 上的实例时,它都会在此时挂起。

Simplest fix is:最简单的修复是:

  1. When the installer hangs, open Windows Services and locate your mySQL service instance(s).当安装程序挂起时,打开 Windows 服务并找到您的 mySQL 服务实例。
  2. Double-click to open the/an instance and set Log on as: to Local System account and check Allow service to interact with desktop .双击打开实例,将Log on as:设置为Local System account并勾选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 Apply and then click Start (or click OK and then start the service).单击应用,然后单击启动(或单击确定,然后启动服务)。
  6. Return to the MySQL Installer and close any open warning about waiting for the process to complete and the process should continue.返回MySQL 安装程序并关闭有关等待进程完成的所有打开警告,进程应继续。
  7. Repeat as required for each MySQL Server instance.根据需要对每个 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.旁注:总而言之,我不得不说,在使用 MySQL 生态系统仅两天后,我对事情的错误印象并不深刻。 I would estimate that I had to set up two server interfaces about 6 times before everything worked as advertised.我估计我必须设置两个服务器接口大约 6 次,然后一切都按宣传的那样工作。 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. Workbench 仅在第一天就让我崩溃了 5 次以上,我不得不在许多论坛中四处游荡,寻找此类问题的答案。 Be prepared to do the same.准备做同样的事情。

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!将空格更改为下划线!

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. MySQL 开发人员坚持以 NETWORK SERVICE 身份运行 MySQL 服务是正确的做法,而以 LOCAL SYSTEM 身份运行它会打开安全漏洞。 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.好的,人们,这里问题的根源在于 NETWORK SERVICE 无法访问日志文件配置所在的位置。 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.就我而言,我指定了要在名为 MySQL Logs 的文件夹中的 My Documents 下写入的日志文件。 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,):所以,(这可以在安装程序对话框打开时完成,它说安装程序需要很长时间,并提示您等待或取消,):

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".我只是通过右键单击该文件夹,选择“属性”,选择“安全”,然后单击“添加”,然后输入“网络服务”,将对该文件夹的完全控制权授予 NETWORK SERVICE。 Then I selected NETWORK SERVICE and clicked the checkboxes Allow for Full control and Modify.然后我选择了网络服务并单击了允许完全控制和修改复选框。

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

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.所以我发现问题是试图启动与 64 位机器上的安装程序捆绑在一起的 32 位版本的 MySQL 可能是问题所在。 Although, MySQL states it will install 64-bit of the database.虽然,MySQL 声明它将安装 64 位数据库。

What I did was downloaded a 64-bit zipped version and unpackaged it into a temporary location.我所做的是下载一个 64 位压缩版本并将其解压缩到一个临时位置。 I re-ran the installer and let it install mysql.重新运行安装程序并让它安装 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.它设法启动了服务。

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 站点

I found another solution: I was using a complex password with special characters in it.我找到了另一个解决方案:我使用了一个包含特殊字符的复杂密码。 When I switch to using only alphanumeric characters in the password, it installed with no issues.当我切换到在密码中只使用字母数字字符时,它安装没有问题。

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.以管理员身份运行命令提示符并执行以下命令以停止和删除 MySQL 服务。

     Net stop MySQL Sc delete MySQL
  2. Go to Control Panel >> Programs >> Programs and Features, select MySQL Server 5.x and click Uninstall.转至控制面板 >> 程序 >> 程序和功能,选择 MySQL Server 5.x 并单击卸载。 (If you can uninstall MySQL from Control Panel) (如果您可以从控制面板卸载 MySQL)

  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”.打开 Windows 资源管理器并转到“组织”>“文件夹和搜索选项”,选择“查看”选项卡,然后在“隐藏的文件和文件夹”下选择“显示隐藏的文件和文件夹”。 Now explore the following locations and delete following folders.现在探索以下位置并删除以下文件夹。

    • C:\\Program Files\\MySQL C:\\程序文件\\MySQL
    • C:\\Program Files (x86)\\MySQL C:\\Program Files (x86)\\MySQL
    • C:\\ProgramData\\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.重新启动您的 PC 并重新安装 MySQL。 That's all!就这样!

I made this problem disappear by upgrading from 5.7 to 8.0.我通过从 5.7 升级到 8.0 使这个问题消失了。

Specifically I:具体我:

None of the above solutions worked for me.以上解决方案都不适合我。 I finally installed an older version.我终于安装了旧版本。 You can look at the version release history from here .您可以从这里查看版本发布历史。 Instead of installing the latest MySQL version 8.0.21.0, I instead installed version 8.0.18.0 from here .我没有安装最新的 MySQL 版本 8.0.21.0,而是从这里安装了版本 8.0.18.0。 It finally worked.它终于奏效了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM