Difference between revisions of "MariaDB binary log"
Jump to navigation
Jump to search
| (34 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
* https://mariadb.com/kb/en/activating-the-binary-log/ | * https://mariadb.com/kb/en/activating-the-binary-log/ | ||
| − | --log-bin=your-log-binname | + | --[[log-bin]]=your-log-binname |
| + | --[[log-bin]]=[[mariadb-bin]] | ||
| + | --[[log-bin]]=[[/your/path/]]mariadb-bin | ||
[[--log_bin_compress]] | [[--log_bin_compress]] | ||
| + | |||
| + | == Steps == | ||
| + | * Define file name for your binary logs or full path including the name in <code>[[log_bin]]</code> option,[[/etc/mysql/mariadb.conf.d/50-server.cnf]]</code> | ||
| + | |||
| + | * Make sure path to your file is owned by <code>[[mysql.adm]]</code>: <code>[[chown]] [[mysql.adm]] [[/your/path/]]</code> | ||
| + | |||
| + | * Restart your db: <code>[[service mariadb restart]]</code> | ||
| + | |||
| + | * Review files are created acording to your configuration: | ||
| + | -rw-rw---- 1 mysql mysql 330 Feb 19 14:03 mariadb-bin.000001 | ||
| + | -rw-rw---- 1 mysql mysql 35 Feb 19 14:03 [[mariadb-bin.index]] | ||
| + | |||
| + | == Config == | ||
| + | |||
| + | cat [[/etc/mysql/mariadb.conf.d/50-server.cnf]] | grep log_bin | ||
| + | #log_bin = [[/var/log/mysql/]]mysql-bin.log | ||
| + | |||
| + | cat [[/etc/mysql/mariadb.conf.d/50-server.cnf]] | grep binlog | ||
| + | [[max_binlog_size]] = 100M | ||
| + | #binlog_do_db = include_database_name | ||
| + | #binlog_ignore_db = exclude_database_name | ||
| + | |||
| + | [[binlog_format]]=ROW | ||
| + | |||
| + | == Format == | ||
| + | * <code>[[SET GLOBAL]] [[binlog_format]]='ROW';</code> | ||
| + | |||
| + | == [[Slave]] == | ||
| + | {{MariaDB slave}} | ||
| + | |||
| + | == Binary logs == | ||
| + | {{file mariadb}} | ||
== Related == | == Related == | ||
| − | * [[PITR]] | + | * [[Point-in-time recovery (PITR)]] |
* <code>[[SET sql_log_bin = 0;]]</code> | * <code>[[SET sql_log_bin = 0;]]</code> | ||
* <code>[[mysqlbinlog]]</code> | * <code>[[mysqlbinlog]]</code> | ||
| + | * <code>[[mariabackup]]</code> | ||
| + | * <code>[[--delete-master-logs]]</code> | ||
| + | * <code>[[/etc/mysql/mariadb.conf.d/50-server.cnf]]</code> | ||
| + | * [[MariaDB Binary Log Formats]] | ||
| + | * [[/var/log/mysql/error.log]] | ||
| + | * [[Oracle Redo log]] | ||
== Activities == | == Activities == | ||
| Line 13: | Line 53: | ||
== See also == | == See also == | ||
| + | * {{MariaDB binary log}} | ||
* {{mariabackup}} | * {{mariabackup}} | ||
| − | + | * {{MariaDB logs}} | |
| − | * {{MariaDB}} | ||
[[Category:MariaDB]] | [[Category:MariaDB]] | ||
Latest revision as of 09:20, 13 May 2026
--log-bin=your-log-binname --log-bin=mariadb-bin --log-bin=/your/path/mariadb-bin --log_bin_compress
Steps[edit]
- Define file name for your binary logs or full path including the name in
log_binoption,/etc/mysql/mariadb.conf.d/50-server.cnf
- Make sure path to your file is owned by
mysql.adm:chown mysql.adm /your/path/
- Restart your db:
service mariadb restart
- Review files are created acording to your configuration:
-rw-rw---- 1 mysql mysql 330 Feb 19 14:03 mariadb-bin.000001 -rw-rw---- 1 mysql mysql 35 Feb 19 14:03 mariadb-bin.index
Config[edit]
cat /etc/mysql/mariadb.conf.d/50-server.cnf | grep log_bin #log_bin = /var/log/mysql/mysql-bin.log
cat /etc/mysql/mariadb.conf.d/50-server.cnf | grep binlog max_binlog_size = 100M #binlog_do_db = include_database_name #binlog_ignore_db = exclude_database_name
binlog_format=ROW
Format[edit]
SET GLOBAL binlog_format='ROW';
Slave[edit]
STOP SLAVE; SET GLOBAL slave_parallel_threads=0; SET GLOBAL binlog_format='ROW'; SET GLOBAL slave_parallel_threads=4; START SLAVE
Binary logs[edit]
file mariadb-bin.index mariadb-bin.index: ASCII text file mariadb-bin.000003 mariadb-bin.000003: MySQL replication log, server id 1 MySQL V5+, server version 10.4.21-MariaDB-1:10.4.21+maria~bionic-log
Related[edit]
- Point-in-time recovery (PITR)
SET sql_log_bin = 0;mysqlbinlogmariabackup--delete-master-logs/etc/mysql/mariadb.conf.d/50-server.cnf- MariaDB Binary Log Formats
- /var/log/mysql/error.log
- Oracle Redo log
Activities[edit]
See also[edit]
Advertising: