D:\tool\mysql\bin>mysqld --initialize
181123 16:34:23 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
181123 16:34:23 [Note] mysqld (mysqld 5.5.62) starting as process 5464 ...
181123 16:34:23 [ERROR] Can't find messagefile 'D:\tool\mysql\bin\share\errmsg.sys'
181123 16:34:23 [Warning] Can't create test file D:\tool\mysql\bin\data\Dude啊.lower-test
181123 16:34:23 [Warning] Can't create test file D:\tool\mysql\bin\data\Dude啊.lower-test
mysqld: Can't change dir to 'D:\tool\mysql\bin\data\' (Errcode: 2)
181123 16:34:23 [ERROR] Aborting
181123 16:34:23 [ERROR] Can't find messagefile 'D:\tool\mysql\bin\share\errmsg.sys'
181123 16:34:23 [Warning] Can't create test file D:\tool\mysql\bin\data\Dude啊.lower-test
181123 16:34:23 [Warning] Can't create test file D:\tool\mysql\bin\data\Dude啊.lower-test
mysqld: Can't change dir to 'D:\tool\mysql\bin\data\' (Errcode: 2)
都是mysql目录下my.ini文件内路径设置问题,本来没有my.ini文件,自己建一个,内容是copy来的,里面的
#Path to installation directory. All paths are usually resolved relative to this.
basedir="D:\\tool\\mysql"
#Path to the database root
datadir="D:\\tool\\mysql\\data"
都应该是mysql所安装对应的路径,data文件也是自己新建的?如果没有data文件可以把my.ini文件里面的
datadir="D:\\tool\\mysql\\data"
注释掉
参考: