If your slave does not also act as a master to another slave, then you should not have any issues from deleting binary logs. The relay logs are important to the slave.
You need to further investigate on why mysql schema disappeared. Is mysql schema still present on the disk, even though MySQL is not showing it? If you have not stopped the slave instance yet, then you could run under same user as MySQL is running:
lsof | grep '/path_to_mysql'
You might see mysql schema tables marked as deleted in there:
(deleted)
Another possibility is that you are connecting with a user that has limited privileges and just does not see mysql schema. Run SHOW GRANTS;
to see what privileges you currently have.
As Rolando pointed out, use PURGE BINARY LOGS as best practice for cleaning up binary logs. If MySQL is down, you could delete the files manually, but then you have to also delete the same file names from the index file. Be careful on master servers, as binary logs might still be needed by slaves.
And if you do need to copy mysql schema, you can do it with just these steps on the slave. Although, I would recommend executing FLUSH TABLES;
on master before doing these steps.
/etc/init.d/mysql stop
scp -rp master_server:/var/lib/mysql/mysql /var/lib/mysql/
/etc/init.d/mysql start
If the slave is not a master to other slaves, then you do not need binary logging on the slave
To reclaim the space of those logs on the Slave immediately, run this
mysql> STOP SLAVE;
mysql> RESET MASTER;
mysql> START SLAVE;
This will hose all binary logs on the Slave.
You could then remove or comment out log_bin from the my.cnf of the Slave and restart mysqld
Best Answer
Whether you use GTID or not, any replica needs a continuous stream of binlogs to keep in sync.
If any of the binlogs needed for the replica to catch up are gone, then it's trash. It can never catch up.
You need to reinitialize the replica. As if you were creating a new replica: make a new backup from the master, and use it to overwrite the replica. Then the replica can catch up from the point you created the backup.