Mysql:As of 8.0.16:--validate-config:新增的服务器配置验证特效:good!
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Mysql:As of 8.0.16:--validate-config:新增的服务器配置验证特效:good!,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含4264字,纯文字阅读大概需要7分钟。
内容图文
![Mysql:As of 8.0.16:--validate-config:新增的服务器配置验证特效:good!](/upload/InfoBanner/zyjiaocheng/521/6c8de59fa5f545bcb3d6fdf50250f71c.jpg)
5.1.3 Server Configuration Validation
As of MySQL 8.0.16, MySQL Server supports a --validate-config
option that enables the startup configuration to be checked for problems without running the server in normal operational mode:
mysqld --validate-config
If no errors are found, the server terminates with an exit code of 0. If an error is found, the server displays a diagnostic message and terminates with an exit code of 1. For example:
shell> mysqld --validate-config --no-such-option
2018-11-05T17:50:12.738919Z 0 [ERROR] [MY-000068] [Server] unknown
option ‘--no-such-option‘.
2018-11-05T17:50:12.738962Z 0 [ERROR] [MY-010119] [Server] Aborting
The server terminates as soon as any error is found. For additional checks to occur, correct the initial problem and run the server with --validate-config
again.
For the preceding example, where use of --validate-config
results in display of an error message, the server exit code is 1. Warning and information messages may also be displayed, depending on the log_error_verbosity
value, but do not produce immediate validation termination or an exit code of 1. For example, this command produces multiple warnings, both of which are displayed. But no error occurs, so the exit code is 0:
shell>mysqld --validate-config --log_error_verbosity=2
--read-only=s --transaction_read_only=s
2018-11-05T15:43:18.445863Z 0 [Warning] [MY-000076] [Server] option ‘read_only‘: boolean value ‘s‘ was not recognized. Set to OFF. 2018-11-05T15:43:18.445882Z 0 [Warning] [MY-000076] [Server] option ‘transaction-read-only‘: boolean value ‘s‘ was not recognized. Set to OFF.
This command produces the same warnings, but also an error, so the error message is displayed along with the warnings and the exit code is 1:
shell>mysqld --validate-config --log_error_verbosity=2
--no-such-option --read-only=s --transaction_read_only=s
2018-11-05T15:43:53.152886Z 0 [Warning] [MY-000076] [Server] option ‘read_only‘: boolean value ‘s‘ was not recognized. Set to OFF. 2018-11-05T15:43:53.152913Z 0 [Warning] [MY-000076] [Server] option ‘transaction-read-only‘: boolean value ‘s‘ was not recognized. Set to OFF. 2018-11-05T15:43:53.164889Z 0 [ERROR] [MY-000068] [Server] unknown option ‘--no-such-option‘. 2018-11-05T15:43:53.165053Z 0 [ERROR] [MY-010119] [Server] Aborting
The scope of the --validate-config
option is limited to configuration checking that the server can perform without undergoing its normal startup process. As such, the configuration check does not initialize storage engines and other plugins, components, and so forth, and does not validate options associated with those uninitialized subsystems.
--validate-config
can be used any time, but is particularly useful after an upgrade, to check whether any options previously used with the older server are considered by the upgraded server to be deprecated or obsolete. For example, the tx_read_only
system variable was deprecated in MySQL 5.7 and removed in 8.0. Suppose that a MySQL 5.7 server was run using that system variable in its my.cnf
file and then upgraded to MySQL 8.0. Running the upgraded server with --validate-config
to check the configuration produces this result:
shell> mysqld --validate-config
2018-11-05T10:40:02.712141Z 0 [ERROR] [MY-000067] [Server] unknown variable
‘tx_read_only=ON‘.
2018-11-05T10:40:02.712178Z 0 [ERROR] [MY-010119] [Server] Aborting
--validate-config
can be used with the --defaults-file
option to validate only the options in a specific file:
shell> mysqld --defaults-file=./my.cnf-test --validate-config
2018-11-05T10:40:02.712141Z 0 [ERROR] [MY-000067] [Server] unknown variable
‘tx_read_only=ON‘.
2018-11-05T10:40:02.712178Z 0 [ERROR] [MY-010119] [Server] Aborting
Remember that --defaults-file
, if specified, must be the first option on the command line. (Executing the preceding example with the option order reversed produces a message that --defaults-file
itself is unknown.)
Mysql:As of 8.0.16:--validate-config:新增的服务器配置验证特效:good!
标签:this limit read_only put erro lan produces opera ble
本文系统来源:https://www.cnblogs.com/jinzhenshui/p/12488470.html
内容总结
以上是互联网集市为您收集整理的Mysql:As of 8.0.16:--validate-config:新增的服务器配置验证特效:good!全部内容,希望文章能够帮你解决Mysql:As of 8.0.16:--validate-config:新增的服务器配置验证特效:good!所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。