Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to get MySQL to display the query that caused replication to stop? I have a DB with hundreds of identical tables, each of which has a trigger to update a related table. One of these is (apparently) not configured properly. I can't use the 'replication skip' trick as it will simply halt at the next write (and there are thousands).

If I can get the actual 'broken' query I can simply amend the table definition.


share|improve this question
up vote 2 down vote accepted

Mysqld logs to syslog where you should see the error and the problematic statements logged. Apart from that, you can call SHOW SLAVE STATUS\G on the slave and look for the "Last_Error" column to get the same information. Additionally, you could use mysqlbinlog to take a look at the slave's relay log to see if there are more similar queries in the queue.

share|improve this answer
Looks good. Had to connect to replication master and view query via mysqlbinlog. – ethrbunny Jul 11 '11 at 19:46

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.