mysql在输入mysqld --initialize --console后出现报错
报错内容如下:
mysqld: Can't create directory 'E:\java瀛︿範鏂囨。\mysql-8.0.16-winx64\data\' (OS errno 2 - No such file or directory)
2021-07-29T01:21:23.596463Z 0 [System] [MY-013169] [Server] E:\javaData\mysql-8.0.16-winx64\bin\mysqld.exe (mysqld 8.0.16) initializing of server in progress as process 16852
2021-07-29T01:21:23.596878Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file 'E:\java瀛︿範鏂囨。\mysql-8.0.16-winx64\share\errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2021-07-29T01:21:23.597960Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2021-07-29T01:21:23.597978Z 0 [Warning] [MY-013242] [Server] --character-set-filesystem: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2021-07-29T01:21:23.600696Z 0 [ERROR] [MY-013236] [Server] Newly created data directory E:\java瀛︿範鏂囨。\mysql-8.0.16-winx64\data\ is unusable. You can safely remove it.
2021-07-29T01:21:23.604666Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-07-29T01:21:23.604936Z 0 [System] [MY-010910] [Server] E:\javaData\mysql-8.0.16-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.16) MySQL Community Server - GPL.
解决方案:
- 地址目录名不可包含中文—更改地址目录文件名称
- 在控制面板中的高级系统设置中的path也需要更改地址目录
- 在my.ini文件中 也需要将basedir和datadir更改
再次运行mysqld --initialize --console后问题解决