Wishlist 0 ¥0.00

MySQL 8.0关闭binlog

MySQL 8.0关闭binlog默认开启binlog,即使在my.ini或my.cnf的[mysqld]部分没有

log_bin

log_bin = mysql-bin

binlog默认在Linux的/var/lib/mysql目录下,文件名为binlog.000001格式,在Windows的data目录下,文件名为binlog.000001格式

相当于默认有 log_bin=binlog 参数

如果需要关闭binlog

在my.ini或my.cnf的[mysqld]部分添加

skip-log-bin

然后重启mysql即可。

 

或者 expire_logs_days =2 ,只保留2天。

 

show global variables like 'log_bin%';

Variable_name |Value |
-------------------------------|---------------------------|
log_bin |ON |
log_bin_basename |/var/lib/mysql/binlog |
log_bin_index |/var/lib/mysql/binlog.index|
log_bin_trust_function_creators|OFF |
log_bin_use_v1_row_events |OFF |

show global variables like '%logs%';

Variable_name |Value |
--------------------------|-------|
binlog_expire_logs_seconds|2592000|
expire_logs_days |0 |
innodb_print_ddl_logs |OFF |

binlog默认保存30天

show global variables like '%binlog_format%';

Variable_name|Value|
-------------|-----|
binlog_format|ROW |
————————————————

About Us

Since 1996, our company has been focusing on domain name registration, web hosting, server hosting, website construction, e-commerce and other Internet services, and constantly practicing the concept of "providing enterprise-level solutions and providing personalized service support". As a Dell Authorized Solution Provider, we also provide hardware product solutions associated with the company's services.
 

Contact Us

Address: No. 2, Jingwu Road, Zhengzhou City, Henan Province

Phone: 0086-371-63520088 

QQ:76257322

Website: 800188.com

E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.