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.

I have 1 master mysql process, and 2 slave.

Today on both slaves i see :

Error 'Table 'bgbilling.contract_status_balance_dump' already exists' on query. Default database: 'bgbilling'. Query: 'CREATE TABLE contract_status_balance_dump( UNIQUE(cid) ) SELECT cid, MAX(yy*12+(mm-1))%12 + 1 AS mm,FLOOR(MAX(yy*12+(mm-1)) / 12) AS yy FROM contract_balance GROUP BY cid'

"show tables" does not show this table.

I tryed stop slave , and do "drop table contract_status_balance_dump" but:

ERROR 1051 (42S02): Unknown table 'contract_status_balance_dump'

How its possible? And how fix that?

share|improve this question
    
This is a strange error. Go to the data directory of the slave and run the following command ls bgbilling/contract_status_balance_dump.* and see what you get. –  mwasif Aug 13 '12 at 0:10
    
Yep, i do that: zsh: no matches found: bgbilling/contract_status_balance_dump.* –  Korjavin Ivan Aug 15 '12 at 4:38

2 Answers 2

up vote 1 down vote accepted

Here is how to fix it

STOP SLAVE;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
use bgbilling
DROP TABLE IF EXISTS contract_status_balance_dump;
CREATE TABLE contract_status_balance_dump( UNIQUE(cid) )
SELECT cid, MAX(yy*12+(mm-1))%12 + 1 AS mm,FLOOR(MAX(yy*12+(mm-1)) / 12) AS yy
FROM contract_balance GROUP BY cid;
START SLAVE;
SHOW SLAVE STATUS\G
share|improve this answer

make sure that when checking the Slave you are running the command ‘ls bgbilling/contract_status_balance_dump’ inside the ‘bgbilling’ database. Hope this is helpful, good luck :)

share|improve this answer

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.