MySQL 8.0.16 社区版安装在 Windows 上停止在“启动服务器”步骤

MySQL 8.0.16 社区版安装在 Windows 上停止在“启动服务器”步骤

我正在尝试在 Windows 10 上安装 MySQL 8.0.16 社区服务器。我一直进入“应用配置”步骤,点击“执行”,然后进入“启动服务器”步骤,但失败了,并告诉我查看日志。日志内容如下:

开始配置步骤:启动服务器

Attempting to start service MySQL80...
Successfully started service MySQL80.
Waiting until a connection to MySQL Server 8.0.16 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.16 after 10 attempts.
Ended configuration step: Starting the server

我确实设置了密码,所以我不知道为什么日志中显示没有密码。
我正在尝试安装它用于工作,所以如果有人能提供一些建议,我将不胜感激!!谢谢。

答案1

您可以尝试通过不配置其他设置来完成设置,而只需设置 InnoDB、安装位置等。尝试以这种方式安装。可以在 MySQL 中设置密码使用此命令创建用户并设置密码

>Create user 'any name'@'your host';
>Alter user 'any name'@'your host' identified by 'the password';

使用此设置权限

>GRANT ALL PRIVILEGES ON *.* TO 'your name'@'your host' identified by 'your password';

使用以下方法检查主机:

>SELECT user,host FROM mysql.user;

您的主机很可能是“localhost”,因此您可以'your host'在上述查询中用替换localhost。只需尝试运行安装程序,而无需进行其他配置。

答案2

在安装 mysql 后的配置阶段,我遇到了同样的问题。我已将 Windows 服务从 重命名为MySQL80MySQL Server 80我返回并在 MySQL 安装程序中恢复了服务名称。此错误已解决。我还转到 service.msc 并禁用了重复的服务,MySQL Server 80因为MySQL80服务也已创建。

答案3

修复此问题的简单方法是取消安装,然后打开 mySQL Workbench。

从那里单击本地实例 MySQL80(或它为您调用的任何名称)。通常这会提示输入密码,但如果您遇到此错误,则不会提示输入密码。

注意左侧的导航器,然后单击“用户和权限”。从那里选择“root”,它将为您提供更改密码的选项。更改密码,应用并重新启动 mySQL。问题已解决!

Tldr:退出安装 -> 打开 MySQL Workbench -> 本地安装 -> 用户和权限 -> root -> 更改密码,应用并重新启动

相关内容