Pages

Wednesday, August 8, 2012

Simple alias - to remember mysql commands and process..

alias -p (your command)


Alias examples ($ represents the command line prompt):
$ alias myalias='alias | grep mysql'
$ alias myenv='env | grep mysql '
$ alias mystat='mysqladmin -u root -p status'
$ alias myestat='mysqladmin -u root -p extended-status'
$ alias myping='mysqladmin -u root -p ping'
$ alias myrun='ps -aux | grep mysql | grep -v grep'
$ alias mysql='mysql -u root -p'
$ alias mystop='mysqladmin -u root -p shutdown'
$ alias mysafe='nohup /../bin/mysqld_safe -- defaults-file=./my.cnf & '


Could not parse relay log event entry.


If a slave show the below error then


Show slave status :


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.


Solution :




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.