We had master to master and master to multiple slave environment in one of our client location. In one of the slave Db host we had disk space issue with bin-logs. At first i deleted the bin-log files manually while the mysql server is running using rm -f binlog.000015, binlog.000016.......binlog.000026. But later i came to know this procedure is wrong by issuing the commmand :
mysql> SHOW BINARY LOGS;
+---------------+-----------+
| Log_name | File_size |
+---------------+-----------+
| 0 | |
| 0 | |
| 0 | |
| binlog.000027 | 724935 |
| binlog.000028 | 733481 |
+---------------+-----------+
What ever the bin logs deleted using rm -rf was not getting cleared in slave. Later i issued the command : PURGE BINARY LOGS TO 'mysql-bin.000026'; and could see the bin logs got cleared properly.
mysql> SHOW BINARY LOGS;
+---------------+-----------+
| Log_name | File_size |
+---------------+-----------+
| binlog.000027 | 724935 |
| binlog.000028 | 733481 |
+---------------+-----------+
But this didnt affected the slave replication and replication is fine. But after some time i could noticed that missing of mysql database. What could be root cause. Whether mysql dropped due to mis handling of the bin-logs.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| client_prod |
+--------------------+
2 rows in set (0.01 sec)
====
As the other slave is fine.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| client_prod |
+--------------------+
3 rows in set (0.00 sec)
We do not see anything indicative of the folder being removed or the database dropped in logs or history. What would be the mystery behind. How could be recover apart from taking dump and restoring, can we take dump of only mysql and restore it in this slave. If doing so will it leads to any replication problem.