在输入mysqld --initialize --console
有些出现
由于找不到vcruntime140_1.dll,无法继续执行代码
下载微软常用运行库合集
还不行的,可以看下这个
https://blog.csdn.net/littlehaes/article/details/104127787
亲测
然后课执行命令,但报错
D:\MySQL\Mysql\mysql-8.0.20-winx64\bin>mysqld --initialize --console
mysqld: Can’t create directory ‘D:\Program Files\MySQL\Data’ (OS errno 2 - No such file or directory)
2020-07-04T11:50:39.057233Z 0 【System】 【MY-013169】 【Server】 D:\MySQL\Mysql\mysql-8.0.20-winx64\bin\mysqld.exe (mysqld 8.0.20) initializing of server in progress as process 14340
2020-07-04T11:50:39.057307Z 0 【ERROR】 【MY-010338】 【Server】 Can’t find error-message file ‘D:\Program Files\MySQL\share\errmsg.sys’. Check error-message file location and ‘lc-messages-dir’ configuration directive.
2020-07-04T11:50:39.059675Z 0 【ERROR】 【MY-013236】 【Server】 The designated data directory D:\Program Files\MySQL\Data\ is unusable. You can remove all files that the server added to it.
2020-07-04T11:50:39.080952Z 0 【ERROR】 【MY-010119】 【Server】 Aborting
2020-07-04T11:50:39.083252Z 0 【System】 【MY-010910】 【Server】 D:\MySQL\Mysql\mysql-8.0.20-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.20) MySQL Community Server - GPL.
我查了下,大部分说已经初始化过了,需要删除data,我依据报错路径找了,一直找不到data文件夹
后来,看了下报的错误,灵机一动,我自己***去该路径下新建了一个该名字的文件夹***又行了
D:\MySQL\Mysql\mysql-8.0.20-winx64\bin>mysqld --initialize --console
2020-07-04T11:52:31.396112Z 0 【System】 【MY-013169】 【Server】 D:\MySQL\Mysql\mysql-8.0.20-winx64\bin\mysqld.exe (mysqld 8.0.20) initializing of server in progress as process 10884
2020-07-04T11:52:31.396184Z 0 【ERROR】 【MY-010338】 【Server】 Can’t find error-message file ‘C:\Program Files\MySQL\share\errmsg.sys’. Check error-message file location and ‘lc-messages-dir’ configuration directive.
2020-07-04T11:52:31.437446Z 1 【System】 【MY-013576】 【InnoDB】 InnoDB initialization has started.
2020-07-04T11:52:33.368977Z 1 【System】 【MY-013577】 【InnoDB】 InnoDB initialization has ended.
2020-07-04T11:52:35.317070Z 6 【Note】 【MY-010454】 【Server】 A temporary password is generated for root@localhost: d+lJd9VmbXSX这里是引用