2010-06-06 58 views
7

這個問題是關於MySQL二進制日誌的。將MySQL中的二進制日誌移至不同的硬盤

我們需要將二進制日誌移動到不同的硬盤上。

MySQL需要什麼配置更改?

當前二進制日誌與ibdata進入同一文件夾,並且存在需要二進制日誌的複製從服務器運行。

回答

2

從我讀the doc的方式,你可以在log-bin配置中指定一個路徑。

To enable the binary log, start the server with the --log-bin[=base_name] option. If no base_name value is given, the default name is the value of the pid-file option (which by default is the name of host machine) followed by -bin. If the basename is given, the server writes the file in the data directory unless the basename is given with a leading absolute path name to specify a different directory. It is recommended that you specify a basename; see Section C.5.8, 「Known Issues in MySQL」, for the reason.

7

更改日誌文件的工作。但是您需要先將日誌文件夾複製到新位置並修改索引文件。如果您dont'do這一點,你會打破你的遠程從站出現錯誤:

得到讀取從二進制日誌數據時的致命錯誤1236從主:「無法找到二進制日誌索引文件的第一個日誌文件名」

更多的信息在這裏: http://freebsd.down-to-details.com/sys-admin/relocating-moving-mysql-binlogs/

+0

如果它是一個多主複製設置。是否同樣適用於發佈的鏈接 – shorif2000 2013-07-01 09:47:37

+0

當我這樣做是在主 - 主設置的情況下......但應該沒有區別... – Rodo 2013-07-01 18:39:24

相關問題