mysql 无法正常显示报错信息:
比如:
SELECT aaa FROM user;
实际显示报错为
[Err]1054 -Unknown error 1054
希望显示为
[Err]1054 - Unknown column 'aaa' in 'field list'
参考原文:https://blog.csdn.net/wittzhang/article/details/82717366
参考原文:https://blog.51cto.com/wujianwei/2087551
查看数据库错误日志
cat /var/log/mysqld.log
显示如下报错
2019-03-28T16:29:50.478350Z 0 [ERROR] Can't find error-message file '/usr/local/mysql/share/mysql/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
缺少errmsg.sys
核实该文件存在路径为
/usr/share/mysql/english/errmsg.sys
vim /etc/my.cnf
新增如下
lc-messages-dir=/usr/share/mysql/english
systemctl stop mysqld
systemctl start mysqld
cat /var/log/mysqld.log
SELECT aaa FROM user;
[Err]1054 - Unknown column 'aaa' in 'field list'