Adding a Windows Firewall rule for MySQL80 on port 33060.
conds before the next connection attempt… Retry 5: Attempting to connect to Mysql@localhost:3306 w
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

文章目录


是按照安装步骤安装的,第一次安装的时候就是这样的报错。

conds before the next connection attempt Retry 5: Attempting to connect to Mysql@localhost:3306 w_mysql

错误日志中的内容如下:

Successfully added 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

确定。

Attempting to connect to Mysql@localhost:3306 with user root with no password...

A、Windows安装MySQL 8.0.15发生错误

conds before the next connection attempt Retry 5: Attempting to connect to Mysql@localhost:3306 w_mysql_02

B、查看安装日志Log

conds before the next connection attempt Retry 5: Attempting to connect to Mysql@localhost:3306 w_解决方法_03

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 FilesMySQLMySQL Server 8.0binmysqld.exe --defaults-file="C:ProgramDataMySQLMySQL Server 8.0my.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 FilesMySQLMySQL Server 8.0binmysqld.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 FilesMySQLMySQL Server 8.0binmysqld.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
C、解决方法

  • 1、Win + R+services.msc打开本地服务,找到MySQL服务
  • conds before the next connection attempt Retry 5: Attempting to connect to Mysql@localhost:3306 w_mysql_04

  • 2、双击打开 —>登录,登录身份—>本地系统账户
  • conds before the next connection attempt Retry 5: Attempting to connect to Mysql@localhost:3306 w_解决方法_05

  • 3、返回MySQL安装界面重试

conds before the next connection attempt Retry 5: Attempting to connect to Mysql@localhost:3306 w_右键_06

原因分析:

MySQL 安装过程中 需要 管理员权限 开启 开机自启 ,因为 Windows 系统 默认打开 .msi 文件 没有以管理员 方式打开的选项 导致 默认安装方式为非管理员方式安装,权限 缺失 导致 上述报错

conds before the next connection attempt Retry 5: Attempting to connect to Mysql@localhost:3306 w_右键_07

给Windows 系统 为win10添加右键“以管理员⾝份运⾏MSI”选项

为win10添加右键“以管理员⾝份运⾏MSI”选项
win+r运⾏
以打开注册表编辑器
regedit
定位到

HKEY_CLASSES_ROOT\Msi.Package\shell

conds before the next connection attempt Retry 5: Attempting to connect to Mysql@localhost:3306 w_mysql_08

右键shell,新建项项名称为
runas
双击runas右边的
,填写
默认
以管理员⾝份运⾏MSI

conds before the next connection attempt Retry 5: Attempting to connect to Mysql@localhost:3306 w_mysql_09

右键runas,新建项项名称为
command
双击command右边的
,填写
默认

msiexec /i"%1"

这时候右键要运⾏的msi⽂件,可以看到

conds before the next connection attempt Retry 5: Attempting to connect to Mysql@localhost:3306 w_解决方法_10


conds before the next connection attempt Retry 5: Attempting to connect to Mysql@localhost:3306 w_解决方法_11

结语

如果这篇文章对您有所帮助,或者有所启发的话,求一键三连:点赞、评论、收藏➕关注,您的支持是我坚持写作最大的动力。