mysql中的二进制日志错误 [英] Binary log error in mysql
问题描述
当我尝试检查二进制日志时:
When I am trying to check binary log:
SHOW BINARY LOGS;
我收到此错误:
错误1381(HY000):您没有使用二进制日志记录.
ERROR 1381 (HY000): You are not using binary logging.
该如何解决?有人可以帮忙吗?
How to resolve this? Can anybody help?
推荐答案
在您的MySQL配置文件中设置log-bin
变量,然后重新启动MySQL.
Set the log-bin
variable in your MySQL configuration file, then restart MySQL.
my.cnf
(在Linux/unix上)或my.ini
(在Windows上)的示例如下所示:
An example my.cnf
(on Linux/unix) or my.ini
(on Windows) would look like:
[client]
...
[mysqld]
...
log-bin=mysql-bin
---
重新启动后,MySQL自动创建一个新的二进制日志(每次重新启动时都会这样做). 您可能还希望查看以下变量:
Once restarted, MySQL automatically creates a new binary log (does so upon every restart). You may also wish to look at the following variables:
server-id = 1
expire_logs_days = 4
sync_binlog = 1
阅读有关 MySQL文档的详细信息.如果您要进行复制设置(使用二进制日志的主要原因),请查看复制配置清单.
Read details on the MySQL documentation. If you're after replication setup (a primary reason for using binary logs), check out Replication configuration checklist.
这篇关于mysql中的二进制日志错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!