前因:windows10 安装了mysql8.0版本,需要换成低版本
结果:折腾了一天,查了N多文章,终于弄好了
错误信息:
mysqld: Can't create directory 'D: oftware\mysql-5.7.27-winx64\data\' (Errcode: 2 - No such file or directory)
2021-10-26T05:24:14.946630Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-10-26T05:24:14.946682Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2021-10-26T05:24:14.946686Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2021-10-26T05:24:14.947118Z 0 [ERROR] Can't find error-message file 'D:\software\mysql-5.7.27-winx64\bin\ oftware\mysql-5.7.27-winx64\share\errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2021-10-26T05:24:14.951107Z 0 [ERROR] Aborting
解决方法:
把basedir和datadir中的 \ 改成 \\
另外记录一下卸载的方法:
1. 可以用remove删除:
mysqld -remove
2. 删除mysql服务,该命令是删除服务中的mysql,用来解决重新安装时提示服务名无效
sc delete mysql
3. 删除注册表中的mysql
HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Services/Eventlog/Applications/MySQL
HKEY_LOCAL_MACHINE/SYSTEM/ControlSet002/Services/Eventlog/Applications/MySQL
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Eventlog/Applications/MySQL