当前位置:网站首页>[solved] after referring to the local MySQL and forgetting the password, [server] --initialize specified but the data directory has files in it Aborti
[solved] after referring to the local MySQL and forgetting the password, [server] --initialize specified but the data directory has files in it Aborti
2022-07-19 02:35:00 【Tamarind_】
Local installation mysql after , Forgot the password , So I found the following article :
https://www.jb51.net/article/215881.htm
The above two connections are used in combination , It can be completely solved under normal circumstances .
But to perform mysqld --initialize --user=mysql --console when , Normally, it should initialize mysql The default password for , But I encountered the following situation :

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.【 Solution 】
Obviously wrong . So I checked the wrong content , Because
①mysql In the installation package ,my.ini Files to be placed in bin Under the folder ;
② May be because data I created the folder manually , There was an error in the file in the initial installation ;
The first time it was installed , A certain Don't create it yourself data Folder ,data Folder is execution install Created automatically when ! So I deleted data Folder ( You can also try deleting only data Contents of the folder ).
Here are the current installation files

When you execute it again , Successfully initialized

Log in to mysql Yes, you can log in ~

After the initialization , Need to change password , Otherwise, the following errors will occur
![]()
Change user password
alter user 'root'@'localhost' identified by 'youpassword';
Refresh the permissions
flush privileges;
After modification , You can use the new password to execute

边栏推荐
猜你喜欢
随机推荐
uniapp微信小程序登录(先授权微信后授权手机号)-- (1)
GoReplay
innodb、Mysql结构、三种删除的区别
Static routing (detailed)
脏读、幻读、不可重复读
2022.6.28-数据库-1.数据库的隔离级别
【Unity编辑器扩展】快速定位资源和脚本的指定文件和路径
【瑞吉外卖⑩】Linux 粗略学习 & Redis 粗略学习
STL -- List container (linked list)
简单的用例编写规范
Detailed explanation of metauniverse public chain caduceus: a creative platform specially built for metauniverse application
简单记录一下并查集
STL -- stack container
元宇宙公链Caduceus详解:专为元宇宙应用打造的创作平台
逆元(名字太多人用我就加这几个字)
Summary of tree and heap knowledge points
How to do a good job of test case review
[Ruiji takeout ⑩] rough learning of Linux & rough learning of redis
Test points of login function
Unity导入fbx模型后,运行时物体的旋转和位置自动改变的问题解决方法









