comp_err creates the comp_err创建errmsg.sys file that is used by mysqld to determine the error messages to display for different error codes. errmsg.sys文件,mysqld使用该文件来确定针对不同错误代码显示的错误消息。comp_err normally is run automatically when MySQL is built. comp_err通常在构建MySQL时自动运行。It compiles the 它根据MySQL源发行版中的文本格式错误信息编译errmsg.sys file from text-format error information in MySQL source distributions:errmsg.sys文件:
As of MySQL 8.0.19, the error information comes from the 从MySQL 8.0.19开始,错误信息来自共享目录中的messages_to_error_log.txt and messages_to_clients.txt files in the share directory.messages_to_error_log.txt和messages_to_clients.txt文件。
For more information about defining error messages, see the comments within those files, along with the 有关定义错误消息的更多信息,请参阅这些文件中的注释以及errmsg_readme.txt file.errmsg_readme.txt文件。
Prior to MySQL 8.0.19, the error information comes from the 在MySQL 8.0.19之前,错误信息来自sql/share目录中的errmsg-utf8.txt file in the sql/share directory.errmsg-utf8.txt文件。
comp_err also generates the comp_err还生成mysqld_error.h, mysqld_ername.h, and mysqld_errmsg.h header files.mysqld_error.h、mysqld_ername.h和mysqld_errmsg.h头文件。
Invoke comp_err like this:按如下方式调用comp_err:
comp_err [options]
comp_err supports the following options.comp_err支持以下选项。
--help, -?
Display a help message and exit.显示帮助消息并退出。
--charset=, dir_name-C dir_name
The character set directory. The default is 字符集目录。默认值为../sql/share/charsets.../sql/share/charsets。
--debug=, debug_options-# debug_options
Write a debugging log. A typical 编写调试日志。典型的debug_options string is d:t:O,. file_namedebug_options字符串是d:t:O,file_name。The default is 默认值为d:t:O,/tmp/comp_err.trace.d:t:O,/tmp/comp_err.trace。
--debug-info, -T
Print some debugging information when the program exits.程序退出时打印一些调试信息。
--errmsg-file=, file_name-H file_name
The name of the error message file. 错误消息文件的名称。The default is 默认值是mysqld_errmsg.h. This option was added in MySQL 8.0.18.mysqld_errmsg.h。此选项是在MySQL 8.0.18中添加的。
--header-file=, file_name-H file_name
The name of the error header file. The default is 错误头文件的名称。默认值是mysqld_error.h.mysqld_error.h。
--in-file=, file_name-F file_name
The name of the input file. The default is 输入文件的名称。默认值为../share/errmsg-utf8.txt.../share/errmsg-utf8.txt。
This option was removed in MySQL 8.0.19 and replaced by the MySQL 8.0.19中删除了此选项,并替换为--in-file-errlog and --in-file-toclient options.--in-file-errlog和--in-file-toclient选项。
--in-file-errlog=, file_name-e file_name
The name of the input file that defines error messages intended to be written to the error log. 定义要写入错误日志的错误消息的输入文件的名称。The default is 默认值为../share/messages_to_error_log.txt.../share/messages_to_error_log.txt。
This option was added in MySQL 8.0.19.此选项是在MySQL 8.0.19中添加的。
--in-file-toclient=, file_name-c file_name
The name of the input file that defines error messages intended to be written to clients. 定义要写入客户端的错误消息的输入文件的名称。The default is 默认值为../share/messages_to_clients.txt.../share/messages_to_clients.txt。
This option was added in MySQL 8.0.19.此选项是在MySQL 8.0.19中添加的。
--name-file=, file_name-N file_name
The name of the error name file. The default is 错误名称文件的名称。默认值是mysqld_ername.h.mysqld_ername.h。
--out-dir=, dir_name-D dir_name
The name of the output base directory. The default is 输出基目录的名称。默认值为../sql/share/.../sql/share/。
--out-file=, file_name-O file_name
The name of the output file. 输出文件的名称。The default is 默认值为errmsg.sys.errmsg.sys。
--version, -V
Display version information and exit.显示版本信息并退出。