database.sarang.net
UserID
Passwd
Database
DBMS
ㆍMySQL
PostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
MySQL Q&A 27354 게시물 읽기
No. 27354
replication 관련 질문입니다.
작성자
김종원
작성일
2008-01-29 18:29ⓒ
2008-01-30 10:08ⓜ
조회수
3,141

흠~~ replication 을 설정하고

master 에서 insert, create, update 관련 쿼리를 실행하면

slave 에 정상적으로 적용 되는걸 확인하였습니다.

그런데.....


밑과 같이 c로 코딩후 실행을 하면

master 에는 정상적으로 insert 가 되는데
slave 에는 적용이 안되는 것입니다..


master 와 slave 에서 각각

show master status;

show slave status;

를 실행해서 보면 replication이 정상적으로 진행한것으로 나오는데~~
도통 이유를 알수 없습니다.


참고로  밑에 show master status; show slave status;  실행 했을때 나온 
결과도 첨부 하였습니다~~~


혹시 이런 경험이 있었던 분이나~~
이유를 알고 계신분 계시면 답변좀 부탁드립니다 ㅜㅜ







c코드

    mysql_init( &mysql );

    if( !mysql_real_connect(&mysql,
                            "localhost",
                            "user",
                            "passwd",
                            NULL,
                            0,
                            NULL,
                            0) ){
        printf("Failed to connect to databases\n");
    }


    memset( sqlstmt, 0x00, sizeof(sqlstmt) );
    sprintf( sqlstmt, "INSERT LBS_PRI.test2(Date) values( now() );");


    printf( "SQL : %s\n", sqlstmt );
    if( mysql_real_query( &mysql, sqlstmt, strlen(sqlstmt)) ){
        tmperrno = mysql_errno( &mysql );
        sprintf(tmperrMsg, "%s", mysql_error(&mysql));

        printf("Query failed:error[%d]errMsg[%s]\n", tmperrno, tmperrMsg );
    }




master/slave 상태 정보~~

mysql> show master status\G;
*************************** 1. row ***************************
            File: mysql-bin.000001
        Position: 6005
    Binlog_Do_DB: LBS_ADMIN,LBS_PRI,LBS_PRI_LOG
Binlog_Ignore_DB: 


mysql> show slave status\G;
*************************** 1. row ***************************
             Slave_IO_State: Waiting for master to send event
                Master_Host: 210.116.110.133
                Master_User: repli
                Master_Port: 3306
              Connect_Retry: 60
            Master_Log_File: mysql-bin.000001
        Read_Master_Log_Pos: 6005
             Relay_Log_File: tws-friend3-relay-bin.000003
              Relay_Log_Pos: 6142
      Relay_Master_Log_File: mysql-bin.000001
           Slave_IO_Running: Yes
          Slave_SQL_Running: Yes
            Replicate_Do_DB:
        Replicate_Ignore_DB:
         Replicate_Do_Table:
     Replicate_Ignore_Table:
    Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
                 Last_Errno: 0
                 Last_Error:
               Skip_Counter: 0
        Exec_Master_Log_Pos: 6005
            Relay_Log_Space: 6142
            Until_Condition: None
             Until_Log_File:
              Until_Log_Pos: 0
         Master_SSL_Allowed: No
         Master_SSL_CA_File:
         Master_SSL_CA_Path:
            Master_SSL_Cert:
          Master_SSL_Cipher:
             Master_SSL_Key:
      Seconds_Behind_Master: 0


이 글에 대한 댓글이 총 1건 있습니다.

db 선택을 안할 경우 그럴수가 있습니다.

/etc/my.cnf에 리플리게이션할 특정 DB를 지정하고 db 선택을 안한 상태 에서 DB.테이블 식으로 
커리를 날릴경우 그런적이 있었던거 같습니다.

replication-do-db  인가?? 이런걸루..

이태현님이 2008-01-30 19:44에 작성한 댓글입니다. Edit
[Top]
No.
제목
작성자
작성일
조회
27357두개 테이블 락이 제대로 작동하지 않습니다.
어문디비
2008-01-31
2609
27356mediumint 로 하면 (9) 이 생기고 mediumint unsigned 로 하면 (9)가 생깁니다
초보
2008-01-30
2456
27355한글이 깨지는 현상... 해결책좀 알려주세요.
이윤섭
2008-01-30
3165
27354replication 관련 질문입니다. [1]
김종원
2008-01-29
3141
27353뷰를 이용한 셀프조인에 대해 질문드립니다.
고재철
2008-01-29
2604
27352DB이전시 한글깨짐
스코필드
2008-01-29
3159
27351[질문] 데이터베이스 물리적 저장위치 문의
새벽소리
2008-01-29
2562
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.024초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다