Answer the question
In order to leave comments, you need to log in
How to save binlog_expire_logs_seconds?
Hello. I have on board
mysql Ver 8.0.23-14 for Linux on x86_64 (Percona Server (GPL), Release '14', Revision '3558242')
mysql> show global variables like 'binlog_expire_logs_seconds';
+----------------------------+---------+
| Variable_name | Value |
+----------------------------+---------+
| binlog_expire_logs_seconds | 2592000 |
+----------------------------+---------+
1 row in set (0.02 sec)
mysql> SET GLOBAL binlog_expire_logs_seconds = 432000;
Query OK, 0 rows affected (0.00 sec)
mysql> show global variables like 'binlog_expire_logs_seconds';
+----------------------------+--------+
| Variable_name | Value |
+----------------------------+--------+
| binlog_expire_logs_seconds | 432000 |
+----------------------------+--------+
1 row in set (0.00 sec)
mysql> flush logs;
Query OK, 0 rows affected (0.02 sec)
mysql> exit
# systemctl restart mysql.service
# mysql -uroot -p
mysql> show global variables like 'binlog_expire_logs_seconds';
+----------------------------+---------+
| Variable_name | Value |
+----------------------------+---------+
| binlog_expire_logs_seconds | 2592000 |
+----------------------------+---------+
1 row in set (0.01 sec)
Answer the question
In order to leave comments, you need to log in
If the global variable needs to be changed without restarting and before restarting the server , then (which is what you are doing)
If the global variable should take a value different from the default when the server starts , then we crawl into the mysql configs (locations differ from the version of mysql/percona/mariadb and distribution)
but in general, grep through the directory with mysql configs (make sure that the directory exists, sometimes just all the configs in /etc/my.cnf), I know that someone (the same package maintainer) has registered a value different from the default
PS: here in general it’s not clear how the UPD was dragged in,
I read it inattentively
SET GLOBAL variable = value;
grep 432000 -r /etc/mysql/
you want to set 432000, and after the restart it is reset to the default 2592000, for some reason I took the information exactly the opposite,
It's simple - you need to write the value in the mysql configs
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question