MYSQL |
|
Here are all the scenarios so far I have experienced.
Locate the MySQL error log |
|
Been having some issues with the application not being able to connect. I needed to look in the MySQL error log, but didn't know how to locate. Here is how to do that.
From command line execute the following. I am logged in as root.
mysqladmin variables | grep log_error
From command line execute the following. I am logged in as root.
mysqladmin variables | grep log_error
Broken MYSQL Replication due to corrupted Relay Log on Slave |
|
Had broken replication.
On the Slave ran
mysql> SHOW SLAVE STATUS\G
Look for LAST_SQL_ERROR:
it shows that there is a corrupted slave relay log
LAST_SQL_ERROR: Relay log read failure: 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
In order to fix had to reset Slave.
Find the following values to use to reset replication
Relay_Master_Log_File: <file name >
Exec_Master_Log_Pos: <it will be a number>
Next you need to stop slave, reset slave and then change replication log file and position parameters
mysql> stop slave;
mysql> reset slave;
mysql> change master to master_log_file='<file name>', master_log_pos=<it will be a number>;
mysql> start slave;
If you need more info please see this link..
https://www.redips.net/mysql/replication-slave-relay-log-corrupted/
On the Slave ran
mysql> SHOW SLAVE STATUS\G
Look for LAST_SQL_ERROR:
it shows that there is a corrupted slave relay log
LAST_SQL_ERROR: Relay log read failure: 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
In order to fix had to reset Slave.
Find the following values to use to reset replication
Relay_Master_Log_File: <file name >
Exec_Master_Log_Pos: <it will be a number>
Next you need to stop slave, reset slave and then change replication log file and position parameters
mysql> stop slave;
mysql> reset slave;
mysql> change master to master_log_file='<file name>', master_log_pos=<it will be a number>;
mysql> start slave;
If you need more info please see this link..
https://www.redips.net/mysql/replication-slave-relay-log-corrupted/