mysql 安装出错,提示“mysqld: Can't change dir to 'D:\MySQL\MySQL Server 5.7\data\'”

https://www.mysql.com/downloads/ 下载 mysql-installer-community-5.7.21.0.msi 时,报错:

mysqld: Can't change dir to 'D:\MySQL\MySQL Server 5.7\data\' (Errcode: 2 - No s
uch file or directory)
2018-02-11T09:25:20.258000Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is
 deprecated. Please use --explicit_defaults_for_timestamp server option (see doc
umentation for more details).
2018-02-11T09:25:20.258000Z 0 [Note] --secure-file-priv is set to NULL. Operatio
ns related to importing and exporting data are disabled
2018-02-11T09:25:20.258000Z 0 [Note] D:\MySQL\MySQL Server 5.7\bin\mysqld.exe (m
ysqld 5.7.20) starting as process 128288 ...
2018-02-11T09:25:20.261000Z 0 [Warning] Can't create test file D:\MySQL\MySQL Se
rver 5.7\data\PC-201709071138.lower-test
2018-02-11T09:25:20.262000Z 0 [Warning] Can't create test file D:\MySQL\MySQL Se
rver 5.7\data\PC-201709071138.lower-test
2018-02-11T09:25:20.262000Z 0 [ERROR] failed to set datadir to D:\MySQL\MySQL Se
rver 5.7\data\
2018-02-11T09:25:20.262000Z 0 [ERROR] Aborting

2018-02-11T09:25:20.262000Z 0 [Note] Binlog end
2018-02-11T09:25:20.263000Z 0 [Note] D:\MySQL\MySQL Server 5.7\bin\mysqld.exe: S
hutdown complete


解决办法, 看 log 是mysql安装路径缺少了 \data\ 文件夹,手动进入安装目录发现果然没有!!!!

于是乎自己创建了一个 D:\MySQL\MySQL Server 5.7\data,然后在尝试 cmd :

mysqld.exe --console

激动人性的时刻到了:

mysql 安装出错,提示“mysqld: Can't change dir to 'D:\MySQL\MySQL Server 5.7\data\'”_第1张图片

到此,证明 mysql 安装成功了,不要谢我~

你可能感兴趣的:(mysql,mysql)