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

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.

Suggestions?

share|improve this question

1 Answer 1

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

 
discard

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.