MySQL installation failed starting the server

MySQL installation failed starting the server

If the computer is installing MySQL for the first time, such an error will generally not appear. Starting the sever failed, usually because the software was not cleaned up last time.
Please add a picture description

The first solution: completely uninstall mysql and reinstall

The way to completely uninstall the software:
Step 1:
1. Find the software MySQL Installer
2. Open it and find remove
3. Remove the installed MySQL server, click next to remove.
4. Click add again to reinstall.
5. Select the appropriate version, click the arrow after selection, and then next to install.
If it still fails at starting the server, it is recommended to use method 2.

Please add a picture description

Step 2: Delete the residual MySQL files in the last installation directory, and don’t forget to delete the MySQL folder under ProgramData, as shown in the figure below. Note: The folder here is different from the residual files in the last installation directory. C:\ProgramData is generally hidden by default.
Step 3: Win+R, enter regedit to run, enter the registry editor, press the path in the figure, find MySQL, and then delete the MySQL registry information.

1、HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL 目录删除
2、HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\MySQL 目录删除
3、HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MySQL 目录删除

Please add a picture description
Step 4: After completing the first three steps, open the service, and you will find that the MySQL57 service still exists, as shown in the figure below. This is an important reason for the failure of the installation, so the MySQL57 service needs to be deleted. Method: Run the dos command with administrator privileges, and then enter sc delete MySQL57.

C:\Windows\system32>sc delete MySQL57
[SC] DeleteService is successful

or right-click to delete Start-Computer Management-Services and Applications-Services-Find MySQL
Please add a picture description
Now you can easily install MySQL software! ! !

The second solution: modify the system settings

1.出现starting the server失败后,不要动任何设置。
2.右键我的电脑,点击管理。
3. 点击服务和应用程序
4.点击服务。
5.找到MySQL右键,点击属性。
​6.选择登录,选择本地系统账户。
7.改好以后,回到安装界面,点击Execute,这样就会安装成功了。
8.环境变量配置:环境变量。

After starting the server fails, do not touch any settings.
(Win11 finds the service according to the above operation)
Right-click My Computer, click Manage-click Services and Applications-click Services-find MySQL, right-click, click Properties-select login, select local system account
! [Please add a picture description](https: //img-blog.csdnimg.cn/49b52d56205a48fd8dec662b425e78f7.pngPlease add a picture description

注:可以把“允许服务与桌面交互”点击

After changing, go back to the installation interface, click Execute, and the installation will be successful!

[Mysql cannot be installed for the second time] How to clean up mysql installation failure?

Step 1: Uninstall the failed Mysql database in the control panel

Step 2: Check whether there is a "Mysql" folder in the C:\ProgramData directory, and delete it if there is.

Step 3: Check whether there is a "Mysql" folder in the C:\Program Files (x86) and C:\Program Files directories, and delete it if there is.

Step Four: Clear the registry.
Search to open the Registry Editor: Start - search for "regedit" - enter the Registry Editor

Method 1: Press Ctrl+F to bring up the quick search box and search for the registration information of "Mysql".
Please add a picture description
Method 2: Delete according to the following path
Delete the HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL folder

Delete the HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\MySQL folder.

Delete the folder of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MySQL .

Step 5: Clear environment variables
Computer - right click - properties - advanced system settings - environment variables
Edit the PATH variable in user variables and system variables, delete the environment variable of Mysql (be careful not to delete the wrong one)
Please add a picture description
pay attention to each computer The value of the PATH variable may be different, just delete the variable of Mysql.
Through the above five steps, I believe that the Mysql data has been completely cleaned up by you, try to install it again.

When using the .\mysqld --install command to install the MySQL service, it does not show success but
The service already exists. This is because mysql has been installed before and has not been deleted.
Re-run as an administrator and enter
sc query mysql
Please add a picture description
to display This interface shows that sc delete mysql has indeed been installed
. After deleting MySQL, continue the installation and it will be successful.

Guess you like

Origin blog.csdn.net/m0_73344394/article/details/131559786