开发工具与关键技术: mysql
撰写时间:2022/9/28
首先说明:笔者在安装第一次的时候就出现以下问题,拿虚拟机安装的时候,同样的步骤,安装成功。主机使用zip安装包安装的时候也可以安装,但会出现一个Can‘t connect to MySQL server on ‘localhost:3306‘ (10061)的bug,如果你也有这个bug推荐你先起看以下链接备份一下数据库解决:Can‘t connect to MySQL server on ‘localhost:3306‘ (10061)_八角.。的博客-CSDN博客_mysql无法连接localhost3306
再看教程重装mysql,因为下周这个bug还会出现,笔者就是重装了5~6次zip安装包受不了才搞这个bug的,经笔者分析这个bug是mysql服务没开起来,怎么都开不起来的那种(╯﹏╰)b
分析bug:
1、安装mysql8.016时到最后一步时,如下图,出现了小红点无法往下执行了,这是安装时出现的问题
2、问题分析及解决办法
- 查看log,log的内容如下,我把log全部贴出来了,我们只看关键几行即可。
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 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.29...
Starting process with command: F:\mySQL\MySQL Server 8.0\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL 8.0\my.ini" --console --initialize-insecure=on --lower-case-table-names=1...
mysqld: File '.\闈掕~娉?bin.index' not found (OS errno 2 - No such file or directory)
'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
F:\mySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.29) initializing of server in progress as process 11956
The newly created data directory C:\ProgramData\MySQL\MySQL 8.0\Data\ by --initialize is unusable. You can remove it.
Aborting
F:\mySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.29) MySQL Community Server - GPL.
Process for mysqld, with ID 11956, was run successfully and exited with code 1.
Failed to start process for MySQL Server 8.0.29.
Database initialization failed.
Ended configuration step: Initializing database (may take a long time)
出现的bug,显示中文乱码...
点击箭头会发现bug翻译为电脑名称...
删除mysql环境:
解决bug:
设置计算机名称为英文或拼音重装mysql,就好了
总结:计算机名别改中文名称,再重装mysql就好了(ಥ_ಥ)
这是我所学到的mysql,所以我要分享给你们,希望可以帮助到你们。
以上就是我的分享,新手上道,请多多指教。如果有更好的方法或不懂得地方欢迎在评论区教导文章来源:https://www.toymoban.com/news/detail-453769.html
和提问喔!文章来源地址https://www.toymoban.com/news/detail-453769.html
到了这里,关于Mysql8.0.16安装时出现的Database initialization failed解决方法的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!