Windows 安装 MySQL 8.0 遇到问题


1-安装 MySQL 8.0 发生错误

Attempting to connect to Mysql@localhost:3306 with user root with no password...
在这里插入图片描述


2-查看安装日志 Log

在这里插入图片描述

Beginning configuration step: Writing configuration file

Saving my.ini configuration file...
Saved my.ini configuration file.
Ended configuration step: Writing configuration file

Beginning configuration step: Updating Windows Firewall rules

Adding a Windows Firewall rule for MySQL80 on port 3306.
Attempting to add a Windows Firewall rule with command: netsh.exe advfirewall firewall add rule name="Port 3306" protocol=TCP localport=3306 dir=in action=allow

尝试联系 Windows Defender 防火墙服务时发生错误。请确保该服务正在运行,然后重试你的请求。

An error occurred running netsh.exe add:
The netsh.exe process did not return any error. Review the application log to see if there is a trace of the error.
The attempt to add a Windows Firewall rule failed.
You can add or delete a Windows Firewall rule manually by following the instructions at this URL:
http://windows.microsoft.com/en-US/windows-vista/Allow-a-program-to-communicate-through-Windows-Firewall
Failed to add the Windows Firewall rule.
Adding a Windows Firewall rule for MySQL80 on port 33060.
Attempting to add a Windows Firewall rule with command: netsh.exe advfirewall firewall add rule name="Port 33060" protocol=TCP localport=33060 dir=in action=allow

尝试联系 Windows Defender 防火墙服务时发生错误。请确保该服务正在运行,然后重试你的请求。

An error occurred running netsh.exe add:
The netsh.exe process did not return any error. Review the application log to see if there is a trace of the error.
The attempt to add a Windows Firewall rule failed.
You can add or delete a Windows Firewall rule manually by following the instructions at this URL:
http://windows.microsoft.com/en-US/windows-vista/Allow-a-program-to-communicate-through-Windows-Firewall
Failed to add the Windows Firewall rule.
Ended configuration step: Updating Windows Firewall rules

Beginning configuration step: Adjusting Windows service

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

Beginning configuration step: Initializing database (may take a long time)

Deleting the data directory from a previous (failed) configuration...
Attempting to run MySQL Server with --initialize-insecure option...
Starting process for MySQL Server 8.0.15...
Starting process with command: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console --initialize-insecure=on --lower-case-table-names=1...
'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.15) initializing of server in progress as process 6128
root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.15) initializing of server has completed
Process for mysqld, with ID 6128, was run successfully and exited with code 0.
Successfully started process for MySQL Server 8.0.15.
MySQL Server 8.0.15 intialized the database successfully.
Ended configuration step: Initializing database (may take a long time)

Beginning configuration step: Starting the server

Attempting to start service MySQL80...
Failed to start service MySQL80.
Waiting until a connection to MySQL Server 8.0.15 can be established (with a maximum of 10 attempts)...
Retry 1: Attempting to connect to Mysql@localhost:3306 with user root with no password...
MySQL error 1042: Unable to connect to any of the specified MySQL hosts.
Waiting 5 seconds before the next connection attempt...
Retry 2: Attempting to connect to Mysql@localhost:3306 with user root with no password...
MySQL error 1042: Unable to connect to any of the specified MySQL hosts.
Waiting 5 seconds before the next connection attempt...
Retry 3: Attempting to connect to Mysql@localhost:3306 with user root with no password...
MySQL error 1042: Unable to connect to any of the specified MySQL hosts.
Waiting 5 seconds before the next connection attempt...
Retry 4: Attempting to connect to Mysql@localhost:3306 with user root with no password...
MySQL error 1042: Unable to connect to any of the specified MySQL hosts.
Waiting 5 seconds before the next connection attempt...
Retry 5: Attempting to connect to Mysql@localhost:3306 with user root with no password...
MySQL error 1042: Unable to connect to any of the specified MySQL hosts.
Waiting 5 seconds before the next connection attempt...
Retry 6: Attempting to connect to Mysql@localhost:3306 with user root with no password...
MySQL error 1042: Unable to connect to any of the specified MySQL hosts.
Waiting 5 seconds before the next connection attempt...
Retry 7: Attempting to connect to Mysql@localhost:3306 with user root with no password...
MySQL error 1042: Unable to connect to any of the specified MySQL hosts.
Waiting 5 seconds before the next connection attempt...
Retry 8: Attempting to connect to Mysql@localhost:3306 with user root with no password...
MySQL error 1042: Unable to connect to any of the specified MySQL hosts.
Waiting 5 seconds before the next connection attempt...
Retry 9: Attempting to connect to Mysql@localhost:3306 with user root with no password...
MySQL error 1042: Unable to connect to any of the specified MySQL hosts.
Waiting 5 seconds before the next connection attempt...
Retry 10: Attempting to connect to Mysql@localhost:3306 with user root with no password...
MySQL error 1042: Unable to connect to any of the specified MySQL hosts.
Failed to connect to MySQL Server 8.0.15 after 10 attempts.
Ended configuration step: Starting the server

3-解决方法

3.1-Win + R -> 输入 services.msc

打开本地服务,找到MySQL服务:
在这里插入图片描述

3.2-双击打开服务 -> 登录 -> 登录身份 -> 本地系统账户

在这里插入图片描述

3.3-返回 MySQL 安装界面重试

在这里插入图片描述


Beginning configuration step: Initializing Database Deleting the data directory from a previous (failed) configuration... Attempting to run MySQL Server with --initialize-insecure option... Starting process for MySQL Server 8.0.13... Starting process with command: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console --initialize-insecure=on --lower-case-table-names=1... 2018-11-01T16:28:35.442346Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release. 2018-11-01T16:28:35.442449Z 0 [System] [MY-013169] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.13) initializing of server in progress as process 12668 mysqld: File '.\绁炴鑸?bin.index' not found (OS errno 2 - No such file or directory) 2018-11-01T16:28:35.449875Z 0 [ERROR] [MY-013236] [Server] Newly created data directory C:\ProgramData\MySQL\MySQL Server 8.0\Data\ is unusable. You can safely remove it. 2018-11-01T16:28:35.450071Z 0 [ERROR] [MY-010119] [Server] Aborting 2018-11-01T16:28:35.450295Z 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.13) MySQL Community Server - GPL. Process for mysqld, with ID 12668, was run successfully and exited with code 1. Failed to start process for MySQL Server 8.0.13. Database initialization failed. Ended configuration step: Initializing Database
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 MySQL57 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: Initializing Database [if necessary] Deleting Data folder shipped Attempting to run MySQL Server with --Initialize-insecure Running process: C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" --initialize-insecure=on --console Waiting for the server stops: C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" --initialize-insecure=on --console 2017-09-19T18:14:08.853281Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2017-09-19T18:14:08.853281Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release. 2017-09-19T18:14:14.079270Z 0 [Warning] InnoDB: New log files created, LSN=45790 2017-09-19T18:14:15.654948Z 0 [Warning] InnoDB: Creating foreign key constraint system tables. mysqld: File '.\绁栧帤涔?slow.log' not found (Errcode: 2 - No such file or directory) 2017-09-19T18:14:15.951298Z 0 [ERROR] Could not use 绁栧帤涔?slow.log for logging (error 2 - No such file or directory). Turning logging off for the server process. To turn it on again: fix the cause, then either restart the query logging by using "SET GLOBAL SLOW_QUERY_LOG=ON" or restart the MySQL server. 2017-09-19T18:14:15.966926Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 58c698a0-9d66-11e7-ab89-201a06371a86. 2017-09-19T18:14:16.138545Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 2017-09-19T18:14:16.388094Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option. Finished initialize database Ended configuration step: Initializing Database [if necessary] Beginning configuration step: Starting Server Starting MySQL as a service
win 10 mysql5.7.17 安装卡在starting server,网上找了很多方法,比如用本地系统账户手动启动,或者删除注册表重装,还有更改my.ini,都没有用。 按照网上的说法也没有找到.err文件,结果发现这个文件直接显示在安装界面上了(尴尬) 下面是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 MySQL57 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: Initializing Database [if necessary] Deleting Data folder shipped Attempting to run MySQL Server with --Initialize-insecure Running process: F:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe --defaults-file="F:\Program Files\MySQL\MySQL Server 5.7\my.ini" --initialize-insecure=on --console Waiting for the server stops: F:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe --defaults-file="F:\Program Files\MySQL\MySQL Server 5.7\my.ini" --initialize-insecure=on --console 2017-09-18T13:50:15.638257Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2017-09-18T13:50:15.638257Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release. 2017-09-18T13:50:25.360635Z 0 [Warning] InnoDB: New log files created, LSN=45790 2017-09-18T13:50:25.907212Z 0 [Warning] InnoDB: Creating foreign key constraint system tables. mysqld: File '.\褰煎コ銇█銇勩伨銇?slow.log' not found (Errcode: 2 - No such file or directory) 2017-09-18T13:50:26.125979Z 0 [ERROR] Could not use 褰煎コ銇█銇勩伨銇?slow.log for logging (error 2 - No such file or directory). Turning logging off for the server process. To turn it on again: fix the cause, then either restart the query logging by using "SET GLOBAL SLOW_QUERY_LOG=ON" or restart the MySQL server. 2017-09-18T13:50:26.141566Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 530d3483-9c78-11e7-9ec9-54e1ad2321ad. 2017-09-18T13:50:26.188451Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 2017-09-18T13:50:26.204073Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option. Finished initialize database Ended configuration step: Initializing Database [if necessary] Beginning configuration step: Starting Server Starting MySQL as a service 路径有问题,是乱码,但是我的安装路径是全英文的,mysqld能在文件夹下找到,在dos下也启动不了。 使用它的默认路径也还是这个问题
©️2020 CSDN 皮肤主题: 创作都市 设计师:CSDN官方博客 返回首页