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

My replication server showing the following error,Please go through the query and tell me your comments.The insert query is working in live DB server Properly , but showing error in replication DB server.

Last_Error: Error 'Subquery returns more than 1 row' on query. Default database: 'Clinical'. Query: 'INSERT INTO document(id, doc_id, pat_id, visit_id,enc_id, f_id, number, ame_yesno, ame_document_id, adyesno, adde_document_id, approved_yesno, active_yesno, last_modified_by, last_modified_date_time, status_id ) VALUES (4722,4722,37745,9293,9513,'754',2,0,'',0,0,'0',1,'VMC0068','2011-04-07 10:55:04', 1 )'

share|improve this question

As you are issuing a simple INSERT INTO without any SELECT statements, check on the constraints defined for your document_master table on your replication slave - is it possible that you have a FOREIGN KEY constraint defined to check on a non-unique column?

share|improve this answer

On your master and slave run the subquery that is returning more than one row on the slave and see if they return the same answer. This could be a data consistency problem. If you are running different versions of MySQL on the master and slave, this could also be an issue. My guess is that the master has one set of data and the slave has another.

share|improve this answer
MySql_5.0.41 is the Mysql version using in both Live and replication DB servers and same database schema also. – Jayakrishnan T Apr 18 '11 at 7:00

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.