添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
2022-06-08T01:36:29.364886Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.23) starting as process 26856
2022-06-08T01:36:29.372881Z 0 [Warning] [MY-010091] [Server] Can't create test file C:\Program Files\MySQL\MySQL Server 8.0\data\mysqld_tmp_file_case_insensitive_test.lower-test
2022-06-08T01:36:29.374008Z 0 [Warning] [MY-010091] [Server] Can't create test file C:\Program Files\MySQL\MySQL Server 8.0\data\mysqld_tmp_file_case_insensitive_test.lower-test
2022-06-08T01:36:29.375508Z 0 [ERROR] [MY-013276] [Server] Failed to set datadir to 'C:\Program Files\MySQL\MySQL Server 8.0\data\' (OS errno: 2 - No such file or directory)
2022-06-08T01:36:29.402135Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-06-08T01:36:29.402240Z 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.23) MySQL Community Server - GPL.

然后添加my.ini配置文件路径解决:

mysqld --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console --skip-grant-tables --shared-memory

不要关闭命令窗口1,新建命令窗口2,然后输入:

myql -u root -p

不输入密码,直接回车进入mysql,然后切换数据到mysql库:use mysql;

更改密码为空(一定要为空):

update user set authentication_string='' where user='root';

然后退出(exit获取quit)

然后关闭(或者ctal+c)命令窗口1.

启动mysql8服务,然后输入mysql -u root -p回车,进入数据库修改密码:

ALTER USER 'root'@'localhost' IDENTIFIED BY '******';
FLUSH PRIVILEGES;

然后退出即可。

文章出处: www.cnblogs.com/jizhong

本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。 否则保留追究法律责任的权利。