报错Log:Database initialization failed.
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 MySQL91 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 MySQL91 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.1.0...
Starting process with command: C:\Program Files\MySQL\MySQL Server 9.1\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 9.1\my.ini" --console --initialize-insecure=on --lower-case-table-names=1...
Process for mysqld, with ID 7608, was run successfully and exited with code -1073741819.
Failed to start process for MySQL Server 9.1.0.
Database initialization failed.
Ended configuration step: Initializing database (may take a long time)
尝试问题复现
寻找方法
- 其他网上的各种尝试啦,比如:
- 修改电脑名字为中文
- 修改my.ini文档里面的文字为中文
- 授权
Beta 版: 使用 Unicode UTF-8 提供全球语言支持(U)
等等,都不太行
- 最终在这篇Blog的指导下解决了这个问题。
- mysql的两个主要问题是
- 卸载不干净,这里我们使用Geek来卸载掉mysql的文件
ProgramData
和Program Files
两个位置的文件,文末有关于MySQL服务
的删除方式。 - 缺少依赖项Microsoft Visual C++ 2013:这里我们使用微软常用运行库合集(Visual C++)2024.11.07来解决。
- 卸载不干净,这里我们使用Geek来卸载掉mysql的文件
附录
- 如何删除已经创建的MySQL91服务:
使用注册表卸载服务
使用Windows + R
快捷键打开「运行」对话框,执行regedit
打开注册表编辑器。导航到以下路径HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
,找到MySQL91
删除即可。方法来自系统极客:4 种简单方法,帮你轻松删除 Windows 服务,我前两种方式没有尝试成功,第四种方式我没有尝试,因为不如第三种方式优雅。 - 另一种安装方式
笔者在问题解决之前是通过把从MySQL官网下载的解压包zip解压之后,根据这篇文档的教程配置初始化文件mysql.ini
和新建data文件夹
也是可以使用的。
来源链接:https://www.cnblogs.com/guiyuan1111/p/18615695/MySQL_Database_initialization_failed
© 版权声明
本站所有资源来自于网络,仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您(转载者)自己承担!
如有侵犯您的版权,请及时联系3500663466#qq.com(#换@),我们将第一时间删除本站数据。
如有侵犯您的版权,请及时联系3500663466#qq.com(#换@),我们将第一时间删除本站数据。
THE END
暂无评论内容