comp_err 创建 errmsg.sys 文件,该文件被 mysqld 用于确定不同错误代码显示的错误消息。comp_err 通常在 MySQL 构建时自动运行。它从 MySQL 源代码分发中的文本格式错误信息编译 errmsg.sys 文件:comp_err creates the
errmsg.sys file that is used by
mysqld to determine the error messages to
display for different error codes. comp_err
normally is run automatically when MySQL is built. It compiles
the errmsg.sys file from text-format error
information in MySQL source distributions:
错误信息来自 share 目录中的 messages_to_error_log.txt 和 messages_to_clients.txt 文件。The error information comes from the
messages_to_error_log.txt and
messages_to_clients.txt files in the
share directory.
有关定义错误信息的更多信息,请参阅这些文件中的注释,以及 errmsg_readme.txt 文件。For more information about defining error messages, see the
comments within those files, along with the
errmsg_readme.txt file.
comp_err 还会生成 mysqld_error.h、mysqld_ername.h 和 mysqld_errmsg.h 头文件。comp_err also generates the
mysqld_error.h,
mysqld_ername.h, and
mysqld_errmsg.h header files.
像这样调用 comp_err:Invoke comp_err like this:
comp_err [options]
comp_err 支持以下选项。comp_err supports the following options.
--help,-?命令行格式Command-Line Format --help--help类型Type 布尔Boolean 默认值Default Value falsefalse显示帮助信息并退出。Display a help message and exit.
--charset=,dir_name-Cdir_name命令行格式Command-Line Format --charset类型Type 字符串String 默认值Default Value ../share/charsets字符集目录。默认目录是
../sql/share/charsets。The character set directory. The default is../sql/share/charsets.--debug=,debug_options-#debug_options命令行格式Command-Line Format --debug=options类型Type 字符串String 默认值Default Value d:t:O,/tmp/comp_err.trace写入调试日志。典型的
debug_options字符串为d:t:O,。默认值为file_named:t:O,/tmp/comp_err.trace。Write a debugging log. A typicaldebug_optionsstring isd:t:O,. The default isfile_named:t:O,/tmp/comp_err.trace.--debug-info,-T命令行格式Command-Line Format --debug-info类型Type 布尔Boolean 默认值Default Value falsefalse程序退出时打印一些调试信息。Print some debugging information when the program exits.
--errmsg-file=file_name,-H file_name--errmsg-file=,file_name-Hfile_name命令行格式Command-Line Format --errmsg-file=name--errmsg-file=name类型Type 文件名File name 默认值Default Value mysqld_errmsg.h错误消息文件的名称。默认值是
mysqld_errmsg.h。The name of the error message file. The default ismysqld_errmsg.h.--header-file=file_name,-H file_name--header-file=,file_name-Hfile_name命令行格式Command-Line Format --header-file=name--header-file=name类型Type 文件名File name 默认值Default Value mysqld_error.h错误头文件的名称。默认是
mysqld_error.h。The name of the error header file. The default ismysqld_error.h.--in-file-errlog=file_name,-e file_name--in-file-errlog=,file_name-efile_name命令行格式Command-Line Format --in-file-errlog类型Type 文件名File name 默认值Default Value ../share/messages_to_error_log.txt定义要写入错误日志的错误信息的输入文件的名称。默认是
../share/messages_to_error_log.txt。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.--in-file-toclient=file_name,-c file_name--in-file-toclient=,file_name-cfile_name命令行格式Command-Line Format --in-file-toclient=path类型Type 文件名File name 默认值Default Value ../share/messages_to_clients.txt定义将要写入客户端的错误信息的输入文件的名称。默认值是
../share/messages_to_clients.txt。The name of the input file that defines error messages intended to be written to clients. The default is../share/messages_to_clients.txt.--name-file=file_name,-N file_name--name-file=,file_name-Nfile_name命令行格式Command-Line Format --name-file=name--name-file=name类型Type 文件名File name 默认值Default Value mysqld_ername.h错误名称文件的名称。默认是
mysqld_ername.h。The name of the error name file. The default ismysqld_ername.h.--out-dir=dir_name,-D dir_name--out-dir=,dir_name-Ddir_name命令行格式Command-Line Format --out-dir=path--out-dir=path类型Type 字符串String 默认值Default Value ../share/输出基础目录的名称。默认是
../sql/share/。The name of the output base directory. The default is../sql/share/.--out-file=file_name,-O file_name--out-file=,file_name-Ofile_name命令行格式Command-Line Format --out-file=name类型Type 文件名File name 默认值Default Value errmsg.sys输出文件的名称。默认值是
errmsg.sys。The name of the output file. The default iserrmsg.sys.--version,-V命令行格式Command-Line Format --version类型Type 布尔Boolean 默认值Default Value falsefalse显示版本信息并退出。Display version information and exit.