>  Q&A  >  본문

binlog - mysql无法开启bin_log

网上所有的方法都试过了。均不可行。
这是我的做法

方法一

首先,查看binlog是否开启

+---------------------------------+-------+
| Variable_name                   | Value |
+---------------------------------+-------+
| log_bin                         | OFF   |
| log_bin_trust_function_creators | OFF   |
| sql_log_bin                     | ON    |
+---------------------------------+-------+

然后,我打开log_gin

SET @@global.log_bin=1

mysql给我报错

ERROR 1238 (HY000): Variable 'log_bin' is a read only variable

方法2

将my.cnf中binlog前面的#删除掉。仍然无效果。我的意思是 重启了也不行啊。

黄舟黄舟2743일 전859

모든 응답(2)나는 대답할 것이다

  • 怪我咯

    怪我咯2017-04-17 13:15:02

    把你 my.cnf 相关配置贴出来吧,可能是有问题的。

    회신하다
    0
  • 迷茫

    迷茫2017-04-17 13:15:02

    SET SQL_LOG_BIN=1
    my.cnf log_bin=mysql-bin# 设置此参数表示启用binlog功能,并指定路径名称
    flush logs;show master logs;#查看日志

    회신하다
    0
  • 취소회신하다