mysqld --initialize 错误:mysqld: Can‘t create/write to file ‘G: ool\mysql\data\is_writable‘

 

最近准备在windows下新部署一个mysql绿色版本。发现出现这个问题,提示我的目录不存在。

G:\tool\mysql\bin>mysqld --initialize
mysqld: Can't create/write to file 'G:  ool\mysql\data\is_writable' (Errcode: 2 - No such file or directory)
2021-06-02T04:01:42.535302Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-06-02T04:01:42.538294Z 0 [ERROR] Can't find error-message file 'G:\tool\mysql\bin\ ool\mysql\share\errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2021-06-02T04:01:42.541286Z 0 [ERROR] --initialize specified but the data directory exists and is not writable. Aborting.
2021-06-02T04:01:42.541286Z 0 [ERROR] Aborting

我发现电脑明明有个这个目录,mysql却找不到。

mysqld --initialize 错误:mysqld: Can‘t create/write to file ‘G: ool\mysql\data\is_writable‘_第1张图片

然后我注意到这一段,mysql打出来的日志,tool文件夹的“t”不见了,我尝试了各种方式,只要以打t头就会有问题。

G:  ool\mysql\data\is_writable' (Errcode: 2 - No such file or directory)

最后我发现\t 有转义的成空格情况。原理是 \t 在数据传输的时候被转义成了空格。

然后实验换成n开头的目录,果然换行了。

G:\nool\mysql\bin>mysqld --initialize
mysqld: Can't create/write to file 'G:
ool\mysql\data\is_writable' (Errcode: 2 - No such file or directory)
2021-06-02T04:18:52.199322Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-06-02T04:18:52.200319Z 0 [ERROR] Can't find error-message file 'G:\nool\mysql\bin\
ool\mysql\share\errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2021-06-02T04:18:52.202314Z 0 [ERROR] --initialize specified but the data directory exists and is not writable. Aborting.
2021-06-02T04:18:52.202314Z 0 [ERROR] Aborting

解决办法:单斜杆换成双斜杆,G:\\tool\\mysql\\data

 

 

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