Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

My MySQL Master (with no connected slaves right now) writes out a 125 byte file every minute or so:

-rw-rw---- 1 mysql mysql        125 2012-12-28 16:46 snapshot-mysql-v2-bin.004876
-rw-rw---- 1 mysql mysql        125 2012-12-28 16:45 snapshot-mysql-v2-bin.004875
-rw-rw---- 1 mysql mysql        125 2012-12-28 16:43 snapshot-mysql-v2-bin.004874
-rw-rw---- 1 mysql mysql        125 2012-12-28 16:41 snapshot-mysql-v2-bin.004873

while writing the actual binary log content to a file with a much lower number:

-rw-rw---- 1 mysql mysql  330755915 2012-12-28 16:48 snapshot-mysql-v2-bin.004472

(and when that file fills up, it goes to the next file).

In addition, MySQL is not writing the name of the actual file with content (004472 above) to the .index file, so when I connect a slave, it can't replicate until I edit the .index file by hand.

MySQL version is 5.1.41-3ubuntu12.10-log.

Any ideas?

share|improve this question
What's in the configuration? –  freiheit Dec 28 '12 at 23:29
binlog_cache_size | 32768 binlog_format | STATEMENT innodb_locks_unsafe_for_binlog | OFF log_bin | ON log_bin_trust_function_creators | OFF log_bin_trust_routine_creators | OFF max_binlog_cache_size | 18446744073709547520 max_binlog_size | 1073741824 sql_log_bin | ON sync_binlog | 0 –  joemastersemison Dec 29 '12 at 11:28
That belongs in the question, both because it's hard to read all on one line in a comment and because it's essential to the question. –  freiheit Dec 29 '12 at 18:43

1 Answer 1

The problem appears to have been that the /var/lib/mysql/ibdata1 file was locked and not writable by MySQL. I found a lot of entries to that effect in the mysql.err file, despite the fact that the MySQL server was functioning fine (and lots of rows were added to InnoDB tables).

To fix, I had to kill off all mysqld instances (mysqladmin shutdown was not enough to get them), and then I ran:

cp -a ibdata1 ibdatanew1

and I edited the my.cnf to point to the ibdatanew1 file. I started up MySQL again, reset the master, flushed the logs, and it's been fine for the past 6 hours.

I am still not clear how the ibdata1 file being locked would have enabled MySQL to continue running, but perhaps the ibdata1 issue was only cropping up with respect to writing the binary log? (Of note, I am used to see ibdata1 issues in the mysqld.log, not the mysql.err log).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.