Bonjour,
J'ai tenté de suivre le principe de réplication, mais je n'arrive apparemment pas à le faire fonctionner.
J'ai, sur les deux serveurs, une même base de données "replicaone" avec une même table "test";
Sur le poste MASTER, création d'un compte :
Je ne sais pas à quoi correspond l'erreur mais le compte est bien créé ...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 mysql> GRANT REPLICATION SLAVE ON replicaone.* -> TO repl@'%' IDENTIFIED BY '123456'; ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES
Aussi je ne souhaite répliquer que la base de données "replicaone". Pas les autres.
Poste MASTER démarré :
Sur le poste SLAVE :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 mysql> show master status; +------------------+----------+--------------+------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +------------------+----------+--------------+------------------+ | mysql-bin.000378 | 107 | | | +------------------+----------+--------------+------------------+
J'ai l'erreur : "Last_IO_Error: Master command COM_REGISTER_SLAVE failed: Access denied FOR user 'repl'@'%' (USING password: YES) (Errno: 1045)"
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49 mysql> CHANGE MASTER TO MASTER_HOST='192.168.0.34', MASTER_USER='repl', MASTER_PASSWORD='123456', MASTER_LOG_FILE='mysql-bin.000378', MASTER_LOG_POS=107; Query OK, 0 rows affected (0.02 sec) mysql> start slave; Query OK, 0 rows affected (0.00 sec) mysql> show slave status\G *************************** 1. row *************************** Slave_IO_State: Waiting to reconnect after a failed registration on master Master_Host: 192.168.0.34 Master_User: repl Master_Port: 3306 Connect_Retry: 60 Master_Log_File: mysql-bin.000378 Read_Master_Log_Pos: 107 Relay_Log_File: Serge-PC-relay-bin.000002 Relay_Log_Pos: 4 Relay_Master_Log_File: mysql-bin.000378 Slave_IO_Running: Connecting 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: 107 Relay_Log_Space: 107 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: NULL Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 1597 Last_IO_Error: Master command COM_REGISTER_SLAVE failed: Access denied for user 'repl'@'%' (using password: YES) (Errno: 1045) Last_SQL_Errno: 0 Last_SQL_Error: Replicate_Ignore_Server_Ids: Master_Server_Id: 1 1 row in set (0.00 sec)
Peut-être est-ce lié à l'erreur 1221 ... Je suis un peu perdu.
Quelqu'un sait-il pourquoi j'obtiens cette erreur d'accès ?
Merci bien par avance !!
N.B : depuis une invite de commandes, j'arrive bien à me connecter depuis SLAVE à MASTER avec le compte 'repl';
Partager