必须要加参数--log-bin[=file_name]启动吗?我一般都是用service mysqld start启动的,我怎么把这个参数加上啊?

解决方案 »

  1.   

    把这个参数写到mysql的配置文件中
      

  2.   

    可以加到你的 /etc/my.cnf 中。
      

  3.   

    我怎么知道它生效了没有啊?在网上查说,通过show variables like 'log_bin'查看二进制日志是否启动,可是我在/etc/my.cnf里加上log-bin=file-name,然后重启MySQL,再查,还是显示off啊!
      

  4.   

    你加在什么位置了? 要加在 [mysqld] 这一节中。
      

  5.   

    不行你就手工 set @@log_bin=on;
      

  6.   

    我的配置文件:
    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    max_allowed_packet = 16M
    table_cache = 512
    sort_buffer_size = 2M
    read_buffer_size = 2M
    read_rnd_buffer_size = 8M
    myisam_sort_buffer_size = 64M
    thread_cache_size = 8
    query_cache_size = 32M
    tmp_table_size=64M
    max_heap_table_size=64M
    log-bin=/home/mysql_bin.log
    # Default to using old password format for compatibility with mysql 3.x
    # clients (those using the mysqlclient10 compatibility package).
    old_passwords=1[mysqld_safe]
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid我再启Mysql启不来了!
      

  7.   

    up up up up up up  up
      

  8.   

    up up up up up up up up