MySQL重装——Database initialization failed错误处理

文章讲述了在无法通过常规方式卸载MySQL后,使用Geek软件清除残留文件和注册表信息以完成卸载,并在重装过程中遇到的问题,如需安装VisualC++2013以解决配置错误,以及数据库初始化失败的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

卸载MySQL

  • 笔者由于跟着网上的教程将MySQL安装到了C盘,忘记了可以走更改路径这条路,在卸载MySQL的路上一去不复返。
  • 试过网上诸多重装方案,大体均为以下步骤:控制面板卸载MySQL→删除注册表→删除ProgramData、Application Data、Program Files (x86)、Program Files里面的MySQL→删除环境变量,然后重启。
  • 最终打开的安装包依旧是“welcome back”
  • 一度令我想要重装系统

以上这种情况就是没有卸载干净

  • 于是尝试了一个新的方法,借助geek软件删除有关MySQL的所有文件夹、注册表等信息。
  • 下面放一个geek百度网盘下载版:百度网盘 提取码:7rbo
  • 功夫不负有心人,终于卸载完毕了

重装MySQL

  • 成功进行重新安装,出现的页面会和第一次安装一样,如果不是,则表示还没有删干净。
  • 存档一个MySQL安装教程:MySQL+Navicat安装配置教程(超级详细、保姆级)
  • 笔者安装的是最新版,与链接安装的版本不同,即没有链接中的提示→【若电脑中没有这个环境,会提示安装“Microsoft Visual C++ 2013”环境】
  • 因此,需要自行下载一个Microsoft Visual C++ 2013。
  • 存档一个Microsoft Visual C++ 2013链接:百度网盘
    提取码:kalu
  • 解释一下为什么要安装这个,因为不安装的话会出现如下错误:
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 MySQL81 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
确定。


Successfully added the Windows Firewall rule.
Adding a Windows Firewall rule for MySQL81 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
确定。


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

Attempting to run MySQL Server with --initialize-insecure option...
Starting process for MySQL Server 8.0.31...
Starting process with command: D:\MySQL\MySQL Server 8.0\bin\mysqld.exe --defaults-file="E:\MySQL\MySQL Server 8.0\my.ini" --console --initialize-insecure=on --lower-case-table-names=1...
Using jemalloc.dll for my_malloc and ut::malloc etc.
D:\MySQL\MySQL Server 8.0\bin\mysqld.exe: Empty value for 'open_files_limit' specified.
Process for mysqld, with ID 15044, was run successfully and exited with code 1.
Failed to start process for MySQL Server 8.0.31.
Database initialization failed.
Ended configuration step: Initializing database (may take a long time)

在这里插入图片描述

  • 装上Vcredist.x86即可执行【笔者需要重启电脑才成功】。
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 MYSQL90 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 确定。 Successfully added the Windows Firewall rule. Attempting to delete a Windows Firewall rule with command: netsh.exe advfirewall firewall delete rule name="Port 0" protocol=TCP localport=0 没有与指定标准相匹配的规则。 An error occurred running netsh.exe delete: The attempt to delete a Windows Firewall rule failed. Adding a Windows Firewall rule for MYSQL90 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 确定。 Successfully added the Windows Firewall rule. Ended configuration step: Updating Windows Firewall rules Beginning configuration step: Adjusting Windows service Attempting to grant the required filesystem permissions to the 'NT AUTHORITY\NetworkService' account. Granted permissions to the data directory. Granted permissions to the install directory. Adding new service New service added Ended configuration step: Adjusting Windows service Beginning configuration step: Initializing database (may take a long time) Attempting to run MySQL Server with --initialize-insecure option... Starting process for MySQL Server 9.0.1... Starting process with command: D:\Program Files\MySQL\MySQL Server 9.0\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 9.0\my.ini" --console --initialize-insecure=on --lower-case-table-names=1... MySQL Server Initialization - start. D:\Program Files\MySQL\MySQL Server 9.0\bin\mysqld.exe (mysqld 9.0.1) initializing of server in progress as process 6204
最新发布
03-26
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值