Solve mysql can not display error message

mysql> select @@version; +------------+ | @@version  | +------------+ | 5.7.21-log | +------------+

mysql can not display error message properly: such as: Mysql> create table testdb.t1 (f1 int); ERROR 1050 (42S01): Unknown error 1050

View mysql background log found that the following error occurred when starting the database: [ERROR] Can't find error-message file '/mysql/3306/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.

解: Find the path to the mysql installation package, I extracted it under /usr/local/mysql. Then add it in my.cnf Lc-messages-dir=/usr/local/mysql/share/

After the database is restarted, the error message can be displayed normally: Mysql> create table testdb.t1 (f1 int); ERROR 1050 (42S01): Table 't1' already exists