安装MySQL时Initializing database出现红叉

安装mysql时Initializing database出现红叉根据部分解决方案(改变计算机名称等,依然不能解决问题)

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
确定。

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
确定。

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.
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.32...
Starting process with command: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console --initialize-insecure=on --lower-case-table-names=1...
C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.32) initializing of server in progress as process 15760
mysqld: File '.\闂備浇宕垫慨鐢稿礉濡ゅ懎纾块柕鍫濐槸閻掑鏌i姀鐘冲暈闁?bin.index' not found (OS errno 2 - No such file or directory)
The designated data directory C:\ProgramData\MySQL\MySQL Server 8.0\Data\ is unusable. You can remove all files that the server added to it.
Aborting
C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.32) MySQL Community Server - GPL.
Process for mysqld, with ID 15760, was run successfully and exited with code 1.
Failed to start process for MySQL Server 8.0.32.
Database initialization failed.
Ended configuration step: Initializing database (may take a long time)

首先卸载MySQL:
1)停止MySQL服务,ctrl+R打开cmd命令界面,输入net stop mysql,出现已停止则成功
2)删除mysql server服务。还是cmd命令界面,输入sc delete mysql,删除成功
1),2)没有成功也没关系,可以继续下面步骤(我就是没成功,不过继续按照下面步骤还是成功了)
3)删除C:\ProgramData里的MySQL文件夹
4)删除C:\Program Files理的MySQL文件夹
5)删除C:\Program Files(x86)里的MySQL文件夹
6)打开控制面板,找到MySQL Installer安装程序,选择卸载(若之前安装时安装了其他组件,可以不卸载,但想重装别的版本的MySQL,还是统一版本为好)
7)删除注册表里面的MySQL(具体可上网查找路径)

切记:安装路径中不要包含中文。

文件路径不要包含中文再试试

该回答引用GPTᴼᴾᴱᴺᴬᴵ
根据错误信息 "File '.\闂備浇宕垫慨鐢稿礉濡ゅ懎纾块柕鍫濐槸閻掑鏌i姀鐘冲暈闁?bin.index' not found (OS errno 2 - No such file or directory)",看起来是MySQL在初始化数据库时找不到指定的文件,可能是由于路径设置不正确或者权限问题导致的。您可以尝试以下解决方案:

  1. 检查路径设置是否正确:请确保指定的数据库路径存在,如果路径不存在或者路径中存在空格或特殊字符可能导致MySQL找不到文件。
  2. 检查权限设置是否正确:请确保指定的数据目录及其父目录对MySQL用户具有足够的权限,您可以将其权限设置为Full Control。
  3. 尝试使用管理员权限安装MySQL:以管理员权限运行安装程序,可以获得更高的权限,有助于解决某些权限问题。
  4. 尝试卸载并重新安装MySQL:如果以上方法无效,建议卸载MySQL并重新安装,可能是安装过程中出现了错误或损坏。

可能是你电脑上运行了其他版本的mysql,可以先卸载老的版本,再安装试试。