My replication stop
Check with
show slave status\G
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.
Check error log
100420 20:28:02 [ERROR] Error running query, slave SQL thread aborted.
Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000078' position 1112628
100420 21:26:58 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000078' at position 1112628, relay log '/usr/local/mysql/relay-bin/relay.000714' position: 002082
100420 21:27:00 [ERROR] Error in Log_event::read_log_event(): 'read error', data_len: 7195, event_type: 16
100420 21:27:00 [ERROR] Error reading relay log event: slave SQL thread aborted because of I/O error
100420 21:27:00 [ERROR] Slave: 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.
Error_code: 0
check relay log '/usr/local/mysql/relay-bin/relay.000714'
log disappear. lateset one is relay.000722
Reset relay log
Check the below information with
show slave status\G
Relay_Master_Log_File: mysql-bin.000078
Exec_Master_Log_Pos: 1996668
The command should be as below
CHANGE master TO master_log_file=Relay_Master_Log_File,master_log_pos=Exec_Master_Log_Pos
So I run this
CHANGE master TO master_log_file=mysql-bin.000078,master_log_pos=1996668
The relay_log in /usr/local/mysql/relay-bin want delete, and new relay log is populate
MYSQL Replication is resume
The above solution work fine for my server
Reference :
http://sql.dzone.com/news/troubleshooting-relay-log-corr
http://www.mysqlperformanceblog.com/2008/08/02/troubleshooting-relay-log-corruption-in-mysql/
Monday, April 26, 2010
Sunday, April 18, 2010
Grant permission - Checking
If we want to know what permissions have grant to the user,
we can use the below command :
mysql>show grants for 'root';
Grants for Root@%
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION
Reference :
http://dev.mysql.com/doc/refman/4.1/en/show-grants.html
if we want to know what user been grant to table, we can use the below method
mysql> select * mysql.tables_priv where table_name='mytable';
+------+--------+---------------+---------------------+----------------+---------------------+---------------+-------------+
| Host | Db | User | Table_name | Grantor | Timestamp | Table_priv | Column_priv |
+------+--------+---------------+---------------------+----------------+---------------------+---------------+-------------+
| % | testdb | test_user | mytable | root@127.0.0.1 | 2009-01-08 18:38:14 | Select,Delete | |
| % | testdb | test_user2 | mytable | | 2010-03-23 16:09:00 | Select | |
+------+--------+---------------+---------------------+----------------+---------------------+---------------+-------------+
we can use the below command :
mysql>show grants for 'root';
Grants for Root@%
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION
Reference :
http://dev.mysql.com/doc/refman/4.1/en/show-grants.html
if we want to know what user been grant to table, we can use the below method
mysql> select * mysql.tables_priv where table_name='mytable';
+------+--------+---------------+---------------------+----------------+---------------------+---------------+-------------+
| Host | Db | User | Table_name | Grantor | Timestamp | Table_priv | Column_priv |
+------+--------+---------------+---------------------+----------------+---------------------+---------------+-------------+
| % | testdb | test_user | mytable | root@127.0.0.1 | 2009-01-08 18:38:14 | Select,Delete | |
| % | testdb | test_user2 | mytable | | 2010-03-23 16:09:00 | Select | |
+------+--------+---------------+---------------------+----------------+---------------------+---------------+-------------+