2.MariaDB激活二进制日志_MySQL
MariaDB
bitsCN.com翻译人员: 铁锚
翻译时间: 2013年12月25日
原文地址: Activating the Binary Log参考了: 《高可用MySQL 构建健壮的数据中心》
要启用二进制日志功能,可以使用 "--log-bin[=name]"选项来启动服务器.
如果文件名中包含了后缀(例如 "--log-bin[=master-bin.log]"),则后缀(".log")将会被忽略.
如果没有指定文件名,默认使用 datadir/log-basename-bin, datadir/mysql-bin 或者 datadir/mariadb-bin(如果也没有 --log-basename选项,根据server版本的不同,会使用后两个中的一个);
datadir 是存放数据(data)的目录,由系统变量 datadir 定义.(启动参数 --datadir=path 或者-h path);
强烈建议: 使用 --log-basename 或者指定二进制日志的文件名,以便服务器的hostname改变以后也不影响复制(replication );
存储二进制日志的目录,用于存放 各个独立的二进制日志文件,以及对这些文件的二进制日志索引(文件).
二进制日志文件的扩展名是一序列的数字.每增加一个日志文件,扩展名的数字就会增加;所以较老的日志的扩展名数字较小,最近的日志的扩展名数字最大。
每次服务器启动,就会启用一个新的二进制日志,当然扩展名也是新的;启动或停止时日志会被强制写入物理文件(平时可能存储在内存缓存中,由操作系统决定何时写入).也可以通过定义max_binlog_size 变量来指定一个数字,当日志累增到此值就会强制写入硬盘.
二进制日志索引文件按顺序储存着所有的二进制日志文件的索引.
datadir下的文件列表示例如下:
1 |
|
二进制日志index文件的名字部分默认与其他的二进制日志文件相同,而扩展名使用".index",当然,index文件的名字也可以通过"--log-bin-index[=filename] " 选项来单独指定.
具有 SUPER 权限的客户端,可以通过设置 sql_log_bin 变量,来为此次会话禁用或者再次启用二进制日志;
(sql_log_bin 是一个session变量,默认值是1,只有具有 SUPER 权限的客户端可以设置;设置为 0 则此客户端的的操作将不记入二进制日志;)
示例如下:
1 |
|
二进制日志的格式
二进制日志有三种格式:
默认是 基于语句的日志(statement-based);
row-based是基于行的日志;
mix是可以混合前面两种日志的格式;
详情请参考: Binary Log Formats
MariaDB服务器所有的配置选项参见: mysqld Options (full list)
MariaDB服务器系统变量参见: Server System Variables bitsCN.com

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



According to news on April 15, 2024, a 2024 CIO and technology executive survey recently released by Gartner shows that more than 60% of Chinese companies plan to deploy generative artificial intelligence (GenAI) in the next 12 to 24 months. Since Chinese companies tend to deploy GenAI locally rather than through the public cloud, the current infrastructure environment cannot support GenAI projects. This will promote the design transformation of Chinese enterprise data centers. Zhang Lukeng, research director at Gartner, said: "Due to security and data privacy concerns and regulatory requirements, some enterprises prefer to deploy GenAl solutions or fine-tune large language models (LLM) on-premises. Deploying GenAl on-premises is important for data centers not just

According to news from this website on June 18, Samsung Semiconductor recently introduced its next-generation data center-grade solid-state drive BM1743 equipped with its latest QLC flash memory (v7) on its technology blog. ▲Samsung QLC data center-grade solid-state drive BM1743 According to TrendForce in April, in the field of QLC data center-grade solid-state drives, only Samsung and Solidigm, a subsidiary of SK Hynix, had passed the enterprise customer verification at that time. Compared with the previous generation v5QLCV-NAND (note on this site: Samsung v6V-NAND does not have QLC products), Samsung v7QLCV-NAND flash memory has almost doubled the number of stacking layers, and the storage density has also been greatly improved. At the same time, the smoothness of v7QLCV-NAND

Binary arithmetic is an operation method based on binary numbers. Its basic operations include addition, subtraction, multiplication and division. In addition to basic operations, binary arithmetic also includes logical operations, displacement operations and other operations. Logical operations include AND, OR, NOT and other operations, and displacement operations include left shift and right shift operations. These operations have corresponding rules and operand requirements.

EDVAC has two major improvements: one is the use of binary, and the other is the completion of stored programs, which can automatically advance from one program instruction to the next, and its operations can be automatically completed through instructions. "Instructions" include data and programs, which are input into the memory device of the machine in the form of codes, that is, the same memory device that stores data is used to store instructions for performing operations. This is the new concept of so-called stored programs.

Binary numbers are represented by 1s and 0s. The 16-bit hexadecimal number system is {0,1,2,3…..9,A(10),B(11),…F(15)} in order to convert from binary representation to hexadecimal Represents that the bit string ID is grouped into 4-bit chunks, called nibbles starting from the least significant side. Each block is replaced with the corresponding hexadecimal number. Let us see an example to get a clear understanding of hexadecimal and binary number representation. 001111100101101100011101 3 E 5 B&nb

How to read binary files in Golang? Binary files are files stored in binary form that contain data that a computer can recognize and process. In Golang, we can use some methods to read binary files and parse them into the data format we want. The following will introduce how to read binary files in Golang and give specific code examples. First, we need to open a binary file using the Open function from the os package, which will return a file object. Then we can make

Title: Easily learn to convert hexadecimal to binary in Go language. Specific code examples are required. In computer programming, conversion operations between different base numbers are often involved. Among them, conversion between hexadecimal and binary is relatively common. In the Go language, we can achieve hexadecimal to binary conversion through some simple code examples. Let us learn together. First, let's take a look at the representation methods of hexadecimal and binary. Hexadecimal is a method of representing numbers, using 0-9 and A-F to represent 1

News from this site on January 19. According to official news from Inspur Server, on January 18, Inspur Information and Intel jointly released the world’s first fully liquid-cooled cold plate server reference design and opened it to the industry to promote fully liquid-cooled cold plate solutions. Large-scale deployment of applications in global data centers. Based on this reference design, Inspur Information launched a fully liquid-cooled cold plate server, claiming to achieve nearly 100% liquid cooling of server components and achieve a PUE value close to 1. Note from this site: PUE is the abbreviation of Power Usage Effectiveness. The calculation formula is "total data center energy consumption/IT equipment energy consumption". The total data center energy consumption includes IT equipment energy consumption and energy consumption of cooling, power distribution and other systems. The higher the PUE Close to 1 represents non-IT equipment consumption
