MySQL 1021: Disk full.

  1. Check the disk space usage:


- Run `df -h` to identify the disk usage and see if the disk is indeed full.

  1. Identify large tables or logs consuming space:


- 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;`

  1. Free up space:


- 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).

  1. Optimize tables after cleanup to reclaim space:


- 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.

Never debug

MySQL

manually again

Let Dr. Droid create custom investigation plans for your infrastructure.

Book Demo
Automate Debugging for
MySQL
See how Dr. Droid creates investigation plans for your infrastructure.

MORE ISSUES

Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid