- Run `df -h` to identify the disk usage and see if the disk is indeed full.
- Connect to the MySQL server: `mysql -u username -p`
- Check table sizes: `SELECT tableschema AS "Database", ROUND(SUM(datalength + indexlength) / 1024 / 1024, 2) AS "Size (MB)" FROM informationschema.TABLES GROUP BY table_schema;`
- Check binary log usage: `SHOW BINARY LOGS;`
- If logs are consuming space, purge binary logs by executing: `PURGE BINARY LOGS TO 'mysql-bin.010';` (replace `mysql-bin.010` with the name of one of the latest few logs).
- If specific tables are identified as large, consider archiving old data and then deleting it from the table: `DELETE FROM table_name WHERE condition;` (ensure to have a backup before doing this).
- Run `OPTIMIZE TABLE table_name;` for the tables you've cleaned up.
Remember to replace `username`, `mysql-bin.010`, `table_name`, and `condition` with your actual MySQL username, the specific binary log file, the actual table names, and the conditions for rows you want to delete, respectively.
(Perfect for DevOps & SREs)
(Perfect for DevOps & SREs)