Have you ever encountered a situation where your database server runs out of disk space, even when the database itself is relatively small? The culprit might be the binary logs.
To assess the disk usage of the logs, you can use the following command:
If you find yourself in this scenario, a straightforward solution is to execute the following MySQL command:
To proactively manage disk space and avoid future log-related issues, consider adjusting the /etc/mysql/my.cnf
configuration file:
This setting ensures the automatic deletion of logs older than 3 days. Remember to restart your MySQL service with service mysql restart to apply these changes effectively.