If a slave show the below error then
1) If the slaves relay-log is corrupted, the run the change master to get the slave in sync with master.
2) we have to import a fresh dump from master to get the slave in sync with master if the master’s binlog is corrupted.
Show slave status :
mysql> show slave status\G
*************************** 1. row ***************************
Master_Host: 10.x.x.39
Master_User: replicate
Master_Port: 3307
Connect_retry: 60
Master_Log_File: db-master.077
Read_Master_Log_Pos: 7400184
Relay_Log_File: db-slave-relay-bin.010
Relay_Log_Pos: 150588765
Relay_Master_Log_File: db-master.076
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_do_db: broadbandnew,archive
Replicate_ignore_db:
Last_errno: 0
Last_error: Could not parse relay log event entry. The possible reasons are: the master’s binary log is corrupted (you can check this by running ‘mysqlbinlog’ on the binary log), the slave’s relay log is corrupted (you can check this by running ‘mysqlbinlog’ on the relay log), a network problem, or a bug in the master’s or slave’s MySQL code. If you want to check the master’s binary log or slave’s relay log, you will be able to know their names by issuing ‘SHOW SLAVE STATUS’ on this slave.
Skip_counter: 0
Exec_master_log_pos: 150588671
Relay_log_space: 157989718
1 row in set (0.00 sec)
Sunday, December 26, 2010
Duplicate entry for key 1′ on query
If the slave show the following error then skip the same as below.
mysql> show slave status\G
*************************** 1. row ***************************
Master_Host: x.x.4.3
Master_User: replicate
Master_Port: 3307
Connect_retry: 60
Master_Log_File: master.077
Read_Master_Log_Pos: 7394212
Relay_Log_File: slave- relay-bin.010
Relay_Log_Pos: 150588010
Relay_Master_Log_File: master.076
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_do_db: bandnew,archive
Replicate_ignore_db:
Last_errno: 1062
Last_error: Error ‘Duplicate entry ‘122453106710.31.87.80-mdazaz123-2008-10-21 03:38:23′ for key 1′ on query. Default database: ‘bandnew’. Query:
‘insert into br_info(UI_ID,UI_USER,CD_CAF,BI_PRODUCT,BI_STIME,BI_ETIME,BI_TIMEUTILIZED,BI_OPENINGBAL,BI_CLBAL,
BI_BILLEDAMT,BI_USERIP,BI_SERVICENAME,BI_BYTESIN,BI_BYTESOUT,BI_BYTES,BI_REMARKS,BI_PUBLICIP,BI_SAMIP) values
(’122453106710.31.87.80′,’mdz123′,’Default’,'D4NL’,'2008-10-21 03:38:23′,
‘2008-10-21 06:10:24′,152,197.09,195.08,’2.01′,’10.31.87.80′,’F',295137740,125414454,420552194,’D',’118.9.4.47′,’210.1.80.3′)’
Skip_counter: 0
Exec_master_log_pos: 150587868
Relay_log_space: 157983746
1 row in set (0.00 sec)
mysql> set global sql_slave_skip_counter=1;start slave;show slave status\G
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
*************************** 1. row ***************************
Master_Host: x.x.4.3
Master_User: replicate
Master_Port: 3307
Connect_retry: 60
Master_Log_File: master.077
Read_Master_Log_Pos: 7394212
Relay_Log_File: slave- relay-bin.010
Relay_Log_Pos: 150588010
Relay_Master_Log_File: master.076
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_do_db: bandnew,archive
Replicate_ignore_db:
Last_errno: 0
Last_error:
Skip_counter: 1
Exec_master_log_pos: 150587868
Relay_log_space: 157983746
1 row in set (0.00 sec)
mysql> show slave status\G
*************************** 1. row ***************************
Master_Host: x.x.4.3
Master_User: replicate
Master_Port: 3307
Connect_retry: 60
Master_Log_File: master.077
Read_Master_Log_Pos: 7394212
Relay_Log_File: slave- relay-bin.010
Relay_Log_Pos: 150588010
Relay_Master_Log_File: master.076
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_do_db: bandnew,archive
Replicate_ignore_db:
Last_errno: 1062
Last_error: Error ‘Duplicate entry ‘122453106710.31.87.80-mdazaz123-2008-10-21 03:38:23′ for key 1′ on query. Default database: ‘bandnew’. Query:
‘insert into br_info(UI_ID,UI_USER,CD_CAF,BI_PRODUCT,BI_STIME,BI_ETIME,BI_TIMEUTILIZED,BI_OPENINGBAL,BI_CLBAL,
BI_BILLEDAMT,BI_USERIP,BI_SERVICENAME,BI_BYTESIN,BI_BYTESOUT,BI_BYTES,BI_REMARKS,BI_PUBLICIP,BI_SAMIP) values
(’122453106710.31.87.80′,’mdz123′,’Default’,'D4NL’,'2008-10-21 03:38:23′,
‘2008-10-21 06:10:24′,152,197.09,195.08,’2.01′,’10.31.87.80′,’F',295137740,125414454,420552194,’D',’118.9.4.47′,’210.1.80.3′)’
Skip_counter: 0
Exec_master_log_pos: 150587868
Relay_log_space: 157983746
1 row in set (0.00 sec)
mysql> set global sql_slave_skip_counter=1;start slave;show slave status\G
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
*************************** 1. row ***************************
Master_Host: x.x.4.3
Master_User: replicate
Master_Port: 3307
Connect_retry: 60
Master_Log_File: master.077
Read_Master_Log_Pos: 7394212
Relay_Log_File: slave- relay-bin.010
Relay_Log_Pos: 150588010
Relay_Master_Log_File: master.076
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_do_db: bandnew,archive
Replicate_ignore_db:
Last_errno: 0
Last_error:
Skip_counter: 1
Exec_master_log_pos: 150587868
Relay_log_space: 157983746
1 row in set (0.00 sec)
Error: log file /mysql/data/mysqld/ib_logfile0 is of different size
ProblemStatement:
I have got the below error while starting the mysql after configuring a new slave with the tall ball of the master data directory.
081022 6:24:41 InnoDB: Warning: shutting down a not properly started
InnoDB: or created database!
081022 6:24:41 /usr/local/mysql4020/libexec/mysqld: Shutdown Complete
InnoDB: Error: log file /mysql/data/mysqld/ib_logfile0 is of different size 0 209715200 bytes
InnoDB: than specified in the .cnf file 0 104857600 bytes!
081022 6:24:42 Can’t init databases
081022 6:24:42 Aborting
Solution :
The same has been resolved by changing the below variable in the cnf file as same in the master config file
innodb_log_file_size = 200M
I have got the below error while starting the mysql after configuring a new slave with the tall ball of the master data directory.
081022 6:24:41 InnoDB: Warning: shutting down a not properly started
InnoDB: or created database!
081022 6:24:41 /usr/local/mysql4020/libexec/mysqld: Shutdown Complete
InnoDB: Error: log file /mysql/data/mysqld/ib_logfile0 is of different size 0 209715200 bytes
InnoDB: than specified in the .cnf file 0 104857600 bytes!
081022 6:24:42 Can’t init databases
081022 6:24:42 Aborting
Solution :
The same has been resolved by changing the below variable in the cnf file as same in the master config file
innodb_log_file_size = 200M
Error: ‘Access denied for user ‘replicate’@'10.0.0.8′ (using password: YES)’
Problem Statement:
we got the below error message while setting the replication.
Error: ‘Access denied for user ‘replicate’@'10.0.0.8′ (using password: YES)’.
Solution :
<18:09:58>root@6.83: ~#mysql -u root -p -h10.0.0.55 -P3306
If the error is password error then edit the password error.
Error: ‘Access denied for user ‘replicate’@'10.0.0.8′ (using password: YES)’
<18:09:58>root@6.83: ~#vi /etc/my.cnf (To change password, edit the cnf file)
<18:09:58>root@6.83: ~#less /data/mysqldata/err.log
mysql> change master to master_password=’xxxxx’;
mysql> change master to master_password=’replicate’,master_user=’replicate’,master_host=’10.0.0.55′,master_port=3306,master_log_file=’narnia-bin.000030′,master_log_pos=271266680;
mysql> stop slave;
mysql> start slave;
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Connecting to master
Master_Host: 10.0.0.55
Master_User: replicate
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: arnia-bin.000030
Read_Master_Log_Pos: 271260976
Relay_Log_File: relay-bin.000004
Relay_Log_Pos: 4
Relay_Master_Log_File: arnia-bin.000030
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table: mail.appearance_new,pop.hostcnt
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 271266680
Relay_Log_Space: 4
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
1 row in set (0.00 sec)
we got the below error message while setting the replication.
Error: ‘Access denied for user ‘replicate’@'10.0.0.8′ (using password: YES)’.
Solution :
<18:09:58>root@6.83: ~#mysql -u root -p -h10.0.0.55 -P3306
If the error is password error then edit the password error.
Error: ‘Access denied for user ‘replicate’@'10.0.0.8′ (using password: YES)’
<18:09:58>root@6.83: ~#vi /etc/my.cnf (To change password, edit the cnf file)
<18:09:58>root@6.83: ~#less /data/mysqldata/err.log
mysql> change master to master_password=’xxxxx’;
mysql> change master to master_password=’replicate’,master_user=’replicate’,master_host=’10.0.0.55′,master_port=3306,master_log_file=’narnia-bin.000030′,master_log_pos=271266680;
mysql> stop slave;
mysql> start slave;
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Connecting to master
Master_Host: 10.0.0.55
Master_User: replicate
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: arnia-bin.000030
Read_Master_Log_Pos: 271260976
Relay_Log_File: relay-bin.000004
Relay_Log_Pos: 4
Relay_Master_Log_File: arnia-bin.000030
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table: mail.appearance_new,pop.hostcnt
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 271266680
Relay_Log_Space: 4
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
1 row in set (0.00 sec)
Got fatal error 1236: ‘Client requested master to start replication from impossible position’ from master when reading data from binary log
Problem statement:
The below is problem I faced in a well running replication system.
Error Message :
081016 18:34:43 Error reading packet from server: Client requested master to start replication from impossible position (ser
ver_errno=1236)
081016 18:34:43 Got fatal error 1236: ‘Client requested master to start replication from impossible position’ from master when reading data from binary log
081016 18:34:43 Slave I/O thread exiting, read up to log ‘lot-bin.000065′, position 13664242
081016 18:35:04 Error reading relay log event: slave SQL thread was killed
081016 18:45:40 Slave SQL thread initialized, starting replication in log ‘lot-bin.000065′ at position 13664242, relay log’./mx5-relay-bin.000001′ position: 13664284
081016 18:45:40 Slave I/O thread: connected to master ‘replicate@10.0.4:3306′, replication started in log ‘lot-bin.
000065′ at position 13664242
Solution :
1) If the value of Read_Master_Log_Pos has a normal value, and slave asked weird position, this could be some internal bug. Now I see only a single way, but it could be difficult: if you have –log-slave-updates, use slave binary logs to find the last executed statement and it’s position in master logs, and CHANGE MASTER to that position.
2) Go onto the master execute
SHOW MASTER STATUS
Look at the output and find the log that the slave is pointing to. Look at the File size field.
Next look at the slave output from the slave reporting the issue. Look at Exec_Master_Log_Pos, is that value greater then the File Size on the master if so issue
CHANGE MASTER TO MASTER_LOG_FILE=[NEXT FILE], MASTER_LOG_POS=4;
slave start;
The below is problem I faced in a well running replication system.
Error Message :
081016 18:34:43 Error reading packet from server: Client requested master to start replication from impossible position (ser
ver_errno=1236)
081016 18:34:43 Got fatal error 1236: ‘Client requested master to start replication from impossible position’ from master when reading data from binary log
081016 18:34:43 Slave I/O thread exiting, read up to log ‘lot-bin.000065′, position 13664242
081016 18:35:04 Error reading relay log event: slave SQL thread was killed
081016 18:45:40 Slave SQL thread initialized, starting replication in log ‘lot-bin.000065′ at position 13664242, relay log’./mx5-relay-bin.000001′ position: 13664284
081016 18:45:40 Slave I/O thread: connected to master ‘replicate@10.0.4:3306′, replication started in log ‘lot-bin.
000065′ at position 13664242
Solution :
1) If the value of Read_Master_Log_Pos has a normal value, and slave asked weird position, this could be some internal bug. Now I see only a single way, but it could be difficult: if you have –log-slave-updates, use slave binary logs to find the last executed statement and it’s position in master logs, and CHANGE MASTER to that position.
2) Go onto the master execute
SHOW MASTER STATUS
Look at the output and find the log that the slave is pointing to. Look at the File size field.
Next look at the slave output from the slave reporting the issue. Look at Exec_Master_Log_Pos, is that value greater then the File Size on the master if so issue
CHANGE MASTER TO MASTER_LOG_FILE=[NEXT FILE], MASTER_LOG_POS=4;
slave start;
ERROR 1251: Client does not support authentication protocol
Problem Statement:
I got the below error while trying to accessing the upgraded mysqld server with a old client.
Error :
ERROR 1251: Client does not support authentication protocol
requested by server; consider upgrading MySQL client
Solution :
I have resolved the above my updating the password as below.
update user set password=old_password(’new_password’) where user=’user_name’ and host=’10.0.0.2′;
flush privileges;
and then try to access the mysqld server and now you will be able to connect to the server succesfully.
I got the below error while trying to accessing the upgraded mysqld server with a old client.
Error :
ERROR 1251: Client does not support authentication protocol
requested by server; consider upgrading MySQL client
Solution :
I have resolved the above my updating the password as below.
update user set password=old_password(’new_password’) where user=’user_name’ and host=’10.0.0.2′;
flush privileges;
and then try to access the mysqld server and now you will be able to connect to the server succesfully.
Can’t get CREATE TABLE (Can’t open file: ‘Tory_Map.MYI’. (errno: 145))
Error Message :
/usr/local/mysql/bin/mysqldump: Can’t get CREATE TABLE for table `Tory_Map` (Can’t open file: ‘Tory_Map.MYI’. (errno: 145))
Solution :
1) Do a show table status as below:
mysql> show table status like ‘Tory_Map’\G
*************************** 1. row ***************************
Name: Tory_Map
Type: NULL
Row_format: NULL
Rows: NULL
Avg_row_length: NULL
Data_length: NULL
Max_data_length: NULL
Index_length: NULL
Data_free: NULL
Auto_increment: NULL
Create_time: NULL
Update_time: NULL
Check_time: NULL
Create_options: NULL
Comment: Can’t open file: ‘Tory_Map.MYI’. (errno: 145)
1 row in set (0.00 sec)
2) and then do a check table as below.
mysql> check table Tory_Map;
+——————+——-+———-+——————————-+
| Table | Op | Msg_type | Msg_text |
+——————+——-+———-+——————————-+
| doc.Tory_Map | check | warning | Table is marked as crashed |
| doc.Tory_Map | check | error | Found 3670180 keys of 3670179 |
| doc.Tory_Map | check | error | Corrupt |
+——————+——-+———-+——————————-+
3 rows in set (20 min 1.65 sec)
3) If the table is marked as crashed then do a repair of that table as below.
mysql> repair table Tory_Map;
+——————+——–+———-+———-+
| Table | Op | Msg_type | Msg_text |
+——————+——–+———-+———-+
| doc.Tory_Map | repair | status | OK |
+——————+——–+———-+———-+
1 row in set (1 min 42.77 sec)
and if you do a check table now, the result has to be ok as below.
mysql> check table Tory_Map;
+——————+——-+———-+———-+
| Table | Op | Msg_type | Msg_text |
+——————+——-+———-+———-+
| doc.Tory_Map | check | status | OK |
+——————+——-+———-+———-+
1 row in set (6 min 3.33 sec)
/usr/local/mysql/bin/mysqldump: Can’t get CREATE TABLE for table `Tory_Map` (Can’t open file: ‘Tory_Map.MYI’. (errno: 145))
Solution :
1) Do a show table status as below:
mysql> show table status like ‘Tory_Map’\G
*************************** 1. row ***************************
Name: Tory_Map
Type: NULL
Row_format: NULL
Rows: NULL
Avg_row_length: NULL
Data_length: NULL
Max_data_length: NULL
Index_length: NULL
Data_free: NULL
Auto_increment: NULL
Create_time: NULL
Update_time: NULL
Check_time: NULL
Create_options: NULL
Comment: Can’t open file: ‘Tory_Map.MYI’. (errno: 145)
1 row in set (0.00 sec)
2) and then do a check table as below.
mysql> check table Tory_Map;
+——————+——-+———-+——————————-+
| Table | Op | Msg_type | Msg_text |
+——————+——-+———-+——————————-+
| doc.Tory_Map | check | warning | Table is marked as crashed |
| doc.Tory_Map | check | error | Found 3670180 keys of 3670179 |
| doc.Tory_Map | check | error | Corrupt |
+——————+——-+———-+——————————-+
3 rows in set (20 min 1.65 sec)
3) If the table is marked as crashed then do a repair of that table as below.
mysql> repair table Tory_Map;
+——————+——–+———-+———-+
| Table | Op | Msg_type | Msg_text |
+——————+——–+———-+———-+
| doc.Tory_Map | repair | status | OK |
+——————+——–+———-+———-+
1 row in set (1 min 42.77 sec)
and if you do a check table now, the result has to be ok as below.
mysql> check table Tory_Map;
+——————+——-+———-+———-+
| Table | Op | Msg_type | Msg_text |
+——————+——-+———-+———-+
| doc.Tory_Map | check | status | OK |
+——————+——-+———-+———-+
1 row in set (6 min 3.33 sec)
Labels:
Can’t get CREATE TABLE,
Can’t open file,
errno: 145
Subscribe to:
Posts (Atom)