Xiaohan practical operation - Mysql binary log

What is the binary log?

       The binary log mainly records changes in the mysql database. The binary log contains all updated data or potentially updated data (such as the delete statement that does not match any row). The statement is saved in the form of time and describes the data change. The binary log also contains time information for executing each update database statement. The main purpose of using the binary log is to recover the database as much as possible. Because the binary log contains all the updates made after the backup, it does not record any statements that did not modify any data.

      The performance overhead of enabling binary logs is very small, and the benefits far outweigh the disadvantages.

Turn on the binary log:

1) Install the database

[root@hya ~]# yum -y install mariadb mariadb-server

 2) Change the configuration file to open the binary log

[root@hya ~]# vim /etc/my.cnf
log-bin =mysql-bin       # 路径及命名,默认在data下
expire_logs_days=10      # 过期时间,二进制文件自动删除的天数,0代表不删除
max_binlog_size=100M     # 单个日志文件大小
binlog_format

Guess you like

Origin blog.csdn.net/yeyslspi59/article/details/108615137