mysql的二进制日志怎么打开?

wj8106 2010-03-23 09:29:26
必须要加参数--log-bin[=file_name]启动吗?我一般都是用service mysqld start启动的,我怎么把这个参数加上啊?
...全文
348 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
wj8106 2010-03-24
  • 打赏
  • 举报
回复
up up up up up up up up
wj8106 2010-03-24
  • 打赏
  • 举报
回复
up up up up up up up
wj8106 2010-03-24
  • 打赏
  • 举报
回复
我的配置文件:
[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启不来了!
ACMAIN_CHM 2010-03-23
  • 打赏
  • 举报
回复
不行你就手工 set @@log_bin=on;
ACMAIN_CHM 2010-03-23
  • 打赏
  • 举报
回复
你加在什么位置了? 要加在 [mysqld] 这一节中。
wj8106 2010-03-23
  • 打赏
  • 举报
回复
我怎么知道它生效了没有啊?在网上查说,通过show variables like 'log_bin'查看二进制日志是否启动,可是我在/etc/my.cnf里加上log-bin=file-name,然后重启MySQL,再查,还是显示off啊!
ACMAIN_CHM 2010-03-23
  • 打赏
  • 举报
回复
可以加到你的 /etc/my.cnf 中。
军爷_010 2010-03-23
  • 打赏
  • 举报
回复
把这个参数写到mysql的配置文件中

56,679

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧