mysql - 重新安装期间无法配置 MySQL
问题描述
我的Windows 10计算机上的 MySQL 服务突然停止并拒绝重新启动。我尝试了许多不同的选项来修复它,但它们都不起作用,所以我决定卸载 MySQL 并重新安装它。
我在卸载前删除了这些文件夹:
- C:\程序文件\MySQL\
- C:\ProgramData\MySQL\
- C:\Users[用户名]\AppData\Roaming\
- C:\Program 文件 (x86)\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\ 中手动创建一个数据文件夹,但这仍然没有解决问题。谁能告诉我为什么我会收到此错误?
解决方案
推荐阅读
- kubernetes - 无法在 Kubernetes 中创建 Secret:输入时非法 base64 数据
- android - 在Android上将按钮移到屏幕上时如何返回以前的活动?
- wordpress - Wordpress 查询一篇文章
- c# - SQL 查询在 SSMS 中有效,但在 C# 中无效:SELECT denied
- android - React Navigation:在抽屉上滑动在 Android 中不起作用
- scikit-learn - 类不平衡的 Scikit-Learn 中的 Micro F1 分数
- javascript - 在 Mongoose 中过滤子文档数组并仅返回匹配的元素
- android - 如何使用焦点元素实现共享元素过渡
- c - 更改结构中的数据
- linux - 比较命令 bash 的数值输出