当前位置:网站首页>【已解决】参考了本地mysql忘记密码后, [Server] --initialize specified but the data directory has files in it. Aborti
【已解决】参考了本地mysql忘记密码后, [Server] --initialize specified but the data directory has files in it. Aborti
2022-07-17 00:14:00 【荼蘼_】
本地安装mysql之后,忘记了密码是啥,于是找到了以下的文章:
https://www.jb51.net/article/215881.htm
以上两个连接结合使用,正常情况下完全可以解决。
但是执行mysqld --initialize --user=mysql --console时,正常应该初始化出mysql的默认密码,但是我遇到了以下的情况:

D:\workSoftWare\anzhuang\mysql-8.0.21-winx64\bin>mysqld --initialize --user=mysql --console
2022-05-07T07:55:57.563900Z 0 [System] [MY-013169] [Server] D:\workSoftWare\anzhuang\mysql-8.0.21-winx64\bin\mysqld.exe (mysqld 8.0.21) initializing of server in progress as process 20852
2022-05-07T07:55:57.565525Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2022-05-07T07:55:57.565534Z 0 [ERROR] [MY-013236] [Server] The designated data directory D:\workSoftWare\anzhuang\mysql-8.0.21-winx64\data\ is unusable. You can remove all files that the server added to it.
2022-05-07T07:55:57.566776Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-05-07T07:55:57.567065Z 0 [System] [MY-010910] [Server] D:\workSoftWare\anzhuang\mysql-8.0.21-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.21) MySQL Community Server - GPL.【解决方案】
很显然是错误的。于是查了一下错误内容,是因为
①mysql的安装包内,my.ini文件要放在bin文件夹下;
②可能因为data文件夹是我手动创建的,最开始安装时里面的文件有错误;
第一次安装时,一定不要自己创建data文件夹,data文件夹是执行install时自动创建的!于是我删除了data文件夹(也可以试试只删除data文件夹里的内容)。
以下是现在的安装文件

再执行的时候,则成功初始化了

登录到mysql是可以登录上的~

初始化后,需要修改密码,否则会出现以下错误
![]()
修改用户密码
alter user 'root'@'localhost' identified by 'youpassword';
刷新权限
flush privileges;
修改成功后,即可用新的密码执行啦

边栏推荐
- Gdb+vscode for debugging 7 - how to debug when there is a segmentation default/ segment error in the program?
- [unity panel attribute literacy] set texture import settings after importing textures
- Gdb+vscode debugging 6 -- Notes on GDB debugging multithreaded commands
- 攻防世界----easytornado笔记
- 【Unity编辑器扩展】显示资源目录下所有文件所占内存大小
- 《Visual C#从入门到精通》个人学习整理
- LeetCode:动态规划中的多重背包问题【一个模板解决所有~】
- [tools] unity screen drawing line, unity screen drawing Hsj drawing tool
- 【Unity面板属性扫盲】导入纹理后设置Texture Import Settings
- 元宇宙公链Caduceus项目详解(一):Caduceus Metaverse Protocol的项目理念及技术框架
猜你喜欢

Swagger——世界上最流行的Api框架

ENVI_ Idl: read the text file and output it in GeoTIFF format + simple mean interpolation

30分钟搞懂 HTTP 缓存

ENVI:(2022年最详细的教程)自定义坐标系

Attack and defense world - easytornado notes

STL--deque容器

JS笔记1

STL -- deque container

STL--queue容器

ENVI_ Idl: batch splice the daily data of MODIS swath and output it in GeoTIFF format
随机推荐
[unity panel attribute literacy] set texture import settings after importing textures
剑指 Offer 53 - I. 在排序数组中查找数字 I
BladeX——精心设计的微服务架构
RuntimeError_ Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor)
【解决方案】win11中本地组策略编辑器(gpedit.msc)打不开
保留两位小数,并向上取值
ENVI:(2022年最详细的教程)自定义坐标系
毕业论文word技巧集合
STL--stack容器
成信大ENVI_IDL第二周课后作业:提取n个点的气溶胶厚度+详细解析
Installing MySQL and JDBC on Windows
元宇宙公链Caduceus详解:专为元宇宙应用打造的创作平台
ENVI_IDL: 读取文本文件并输出为Geotiff格式+简单均值插值
【Unity编辑器扩展】Unity内部Asset资源配置ScriptableObject
【Unity编辑器扩展】Unity制作自己的专属的编辑器面板
BUAAOS-Lab0实验报告
leetcode---每日一题
ENVI_IDL:批量处理Modis Swath数据的重投影并输出为Geotiff格式+详细解析
SSTI模板注入
ENVI_IDL:批量重投影ModisSwath产品(调用二次开发接口)+解析