cmd 下执行 输出错误日志
C:\software\mysql-8.0.20-winx64\bin>mysqld.exe --validate-config --log-error=error.log
2020-05-31T13:21:24.736679Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file 'C:\software\mysql-8.0.20-winx64\bin\ oftware\mysql-8.0.20-winx64\share\errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
C:\software\mysql-8.0.20-winx64\bin>mysqld.exe --validate-config --log-error=error.log
2020-05-31T13:22:59.594770Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file 'C: oftware\mysql-8.0.20-winx64 hare\errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
发现路径不对,
my.ini 中的 \s被转义了(\s代表正则表达式中的一个空白字符)
修改如下:
# 设置mysql的安装目录
basedir="C:\\software\\mysql-8.0.20-winx64"
# 设置mysql数据库的数据的存放目录
datadir="C:\\software\\mysql-8.0.20-winx64\\data"
打印输出MySQL 错误日志配置如下:
# 在my.ini中添加
log-error="C:\\software\\mysql-8.0.20-winx64\\logs\\mysql_log_err.log"