MySQL binary log file expiration days setting description

Source: Internet
Author: User

Today, when working with binaries in the business library, you want to change the number of days that the binaries expire, and if the discovery date is set to 2-bit integers. The following warning will appear. The expiration date number of days cannot be set successfully. The MySQL version is the same from 5.1 to 5.5.


mysql> set global expire_logs_days=100; Query OK, 0 rows affected, 1 Warning (0.00 sec)  mysql> Show warnings;+---------+------+------------------------- --------------------------+| Level   | Code | Message                                 &N Bsp         |+---------+------+---------------------------------------------------+| Warning | 1292 | Truncated incorrect Expire_logs_days value: ' |+---------+------+---------------------------------------------- -----+1 Row in Set (0.00 sec)  ps: The same effect is changed in the configuration file my.cnf, for example, you set the value to  expire_logs_days= 199 (2-bit positive integer), restart the service, View the list of parameters and the results are as follows. Mysql> Show variables like ' expire_logs_days '; +------------------+-------+| Variable_name    | Value |+------------------+-------+| Expire_logs_days |    |+------------------+-------+1 row in Set (0.00 sec)   Change date parameter can only be changed to 99. mysql> set global expire_logs_days=99; Query OK, 0 rows Affected (0.00 sec)  mysql> Show variables like ' expire_logs_days '; +------------------+-------+| Variable_name    | Value |+------------------+-------+| Expire_logs_days |    |+------------------+-------+1 row in Set (0.00 sec)  mysql> set global expire_logs_days=0.5; ERROR 1232 (42000): Incorrect argument type to variable ' expire_logs_days ' description: The parameter does not support floating-point numbers, only positive integers are supported.  ps:mysql The default expire_logs_days=0, log files are not automatically deleted. If the log file is too large and the business requires it, you can only manually archive the compressed backup. For unimportant logs, you can set the value of Expire_logs_days, and you need to be aware that only 99 is supported. If it does not matter, there is no need to save 99 days ha.

MySQL binary log file expiration days setting description

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.