Home  >  Q&A  >  body text

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 days ago863

reply all(2)I'll reply

  • 怪我咯

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

    Post your my.cnf related configuration, there may be something wrong.

    reply
    0
  • 迷茫

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

    SET SQL_LOG_BIN=1
    my.cnf log_bin=mysql-bin# Setting this parameter means enabling the binlog function and specifying the path name
    flush logs;show master logs;#View logs

    reply
    0
  • Cancelreply