首页 > 解决方案 > 重新安装期间无法配置 MySQL

问题描述

我的Windows 10计算机上的 MySQL 服务突然停止并拒绝重新启动。我尝试了许多不同的选项来修复它,但它们都不起作用,所以我决定卸载 MySQL 并重新安装它。

我在卸载前删除了这些文件夹:

在重新安装期间,我注意到 Connector .NET 安装失败。

我不确定这是否是问题发生的原因,但安装程序反复失败了配置的“备份 MySQL 数据库”步骤。每次我运行它时,它都会显示以下错误消息:

Starting MySQL Server in order to run the mysql_upgrade tool.
Warning: There may be some errors thrown by MySQL Server, the mysql_upgrade tool is going to be run next to attempt to fix database incompatibilities.
Starting process for MySQL Server 8.0.21...
Starting process with command: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe --port=3306 --datadir="C:\ProgramData\MySQL\MySQL Server 8.0\data" --console...
Process for mysqld, with ID 12424, has been started successfully and is running.
Successfully started process for MySQL Server 8.0.21.
2020-08-19T16:52:16.133223Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.21) starting as process 7612
2020-08-19T16:52:16.251679Z 1 [ERROR] [MY-011011] [Server] Failed to find valid data directory.
2020-08-19T16:52:16.254844Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2020-08-19T16:52:16.255289Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-08-19T16:52:16.261307Z 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.21)  MySQL Community Server - GPL.........................
Running mysqldump tool to backup the database...
Backup files will be dumped to "C:\ProgramData\MySQL\MySQL Server 8.0\Backup\mysql_dump-2020-08-19T12.55.23.sql".

Starting process with command: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqldump.exe --user=root --default-auth=caching_sha2_password --host=localhost --port=3306 --default-character-set=utf8 --routines --events --single-transaction=TRUE --all-databases --result-file="C:\ProgramData\MySQL\MySQL Server 8.0\Backup\mysql_dump-2020-08-19T12.55.23.sql"...
mysqldump: Got error: 2003: Can't connect to MySQL server on 'localhost' (10061) when trying to connect
Process for mysqldump, with ID 18972, was run successfully and exited with code 2.
Ended configuration step: Backing up MySQL database


Found existing data directory, no need to initialize the database.

我不能跳过配置,因为 MySQL 还没有作为服务出现。

我尝试在 C:\ProgramData\MySQL\MySQL Server 8.0\ 中手动创建一个数据文件夹,但这仍然没有解决问题。谁能告诉我为什么我会收到此错误?

标签: mysqldevops

解决方案


推荐阅读