MySQL error 28 and solution

MySQL error 28 and solution

The error "ERROR 28 (HY000): No space left on device" typically occurs when the MySQL server is unable to write to the disk because there is no more free space available. This error can be caused by a number of factors, including a full disk, a large number of large tables or indexes, or insufficient disk space for temporary files.

To troubleshoot this error, you can try the following steps:

  1. Check the disk space. Make sure that there is enough free space on the disk where the MySQL data directory is located. You can use the df command to check the available disk space:
refer ‮l:ot‬autturi.com
df -h

If the disk is full, you will need to make more space available by deleting unnecessary files or moving some data to another disk.

  1. Check the size of your tables and indexes. If you have a large number of large tables or indexes, it may be causing the error. You can use the SELECT and SUM commands to check the size of your tables and indexes:
SELECT table_schema "Database", sum(data_length + index_length) / 1024 / 1024 "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema;

This will show the size of all tables and indexes for each database on the MySQL server. If any of the tables or indexes are taking up a significant amount of space, you may want to consider optimizing or partitioning them to reduce their size.

  1. Check the size of your temporary files. MySQL uses temporary files for various operations, such as sorting and grouping data. If you are running large queries that generate a lot of temporary data, it may be causing the error. You can use the SHOW VARIABLES command to check the size of your temporary files:
SHOW VARIABLES LIKE 'tmp%';

This will show the size of your temporary files. If the size of your temporary files is close to the available disk space, you may want to consider optimizing your queries to reduce the amount of temporary data generated.

  1. Check the MySQL error log. The MySQL error log may contain more information about the cause of the error. You can check the MySQL error log by looking in the /var/log/mysql/ directory.

If these steps do not help resolve the error, you may need to seek further assistance from your MySQL administrator or support team.

Created Time:2017-10-30 10:17:51  Author:lautturi