Domanda

I have a master mysql server which is working fine.on show status command it gives

+-------------------+----------+--------------+------------------+
| File              | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+-------------------+----------+--------------+------------------+
| master-bin.000004 |  181     |              |                  |
+-------------------+----------+--------------+------------------+

and now i am trying to set up a slave for that

salve my.ini config is

MASTER_HOST='master ip',
MASTER_PORT=3306,
MASTER_USER='repluser',
MASTER_PASSWORD='slavepass',

server­-id = 2 
relay­-log-­index = slave-­relay-­bin.index
relay­-log = slave­-relay­-bin
replicate-wild-ignore-table=mysql.%
replicate-wild-ignore-table=information_schema.%
replicate-wild-ignore-table=performance_schema.%

but when i check slave status i get some error as follows

| Waiting for master to send event | 10.0.100.168 | repl        |        3306 |
           60 | mysql-bin.000004 |                 181 | mysql-relay-bin.000002
|           638 | mysql-bin.000001      | Yes              | No                |
                 |                     |                    |
     |                         |                             |       1062 | Erro
r 'Duplicate entry '3094' for key 'PRIMARY'' on query. Default database: ''. Que
ry: 'INSERT INTO
                `phpmyadmin`.`pma_history`
              (`username`,
                `db`,
                `table`,
                `timevalue`,
                `sqlquery`)
         VALUES
              ('root',
               '',
               '',
               NOW(),
               'SHOW PROCESSLIST')' |            0 |                 493 |
      6232 | None            |                |             0 | No
   |                    |                    |                 |
   |                |                  NULL | No                            |
          0 |               |           1062 | Error 'Duplicate entry '3094' for
 key 'PRIMARY'' on query. Default database: ''. Query: 'INSERT INTO
                `phpmyadmin`.`pma_history`
              (`username`,
                `db`,
                `table`,
                `timevalue`,
                `sqlquery`)
         VALUES
              ('root',
               '',
               '',
               NOW(),
               'SHOW PROCESSLIST')' |

note:error is copied from command promt Both systems run on windows7 with XAMPP stack on the same local network

Is it because my current slave is already having some databases in that?

È stato utile?

Soluzione

add replicate-wild-ignore-table=phpmyadmin.% to your slave server my.ini file.

because it is trying to copy data to the phpmyadmin.pma_hostory table which already have data in it.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top