Error 28 from Storage Engine is one of the very common error if your backend is connected with MySQL database. In this post, I am going to explain you how to troubleshoot Error 28 from Storage Engine.

Java application will throw java.sql.SQLException: Got error 28 from storage engine exception to indicate MySQL Error 28 from Storage Engine.

Reason for Error 28 from Storage Engine

This error is because of disk space is full and there is not enough disk space to execute and perform operations of MySQL queries.

Troubleshoot Error 28 from Storage Engine

Step 1: Check disk space using df -h . Result will be something like below.


[root@sp /var]$ df -h
Filesystem   Size    Used    Avail    Use%     Mounted on
/dev/sda1    20G      20G        0    100%     /
udev        568K     9.5M     9.5M      6%     /dev
....		
	

This shows that disk space is full on server.

Step 2: Above scenario might happen because applications like MySQL, Apache, Tomcat etc… generates log files. This log files sometimes grow in GB if proper mechanism is not in place to move old logs.

Most common place to store log files on linux servers are /var/log and /tmp folder. To check your storage space use du -h command. Server could have been configured to store log files to other locations as well.



[root@sp /var]$cd /var/log
[root@sp /var/log]$ du -h
600K    /var/log/installer
424K    /var/log/mysql
8.2G    /var/log/apache2
250M    /var/log/tomcat5.5
8.5G    /var/log
	

It shows that /var/log/apache2 is storing 8.2GB of log files.

Step 3: To solve the problem, consider backing up old log files and creating disk space on server. Restart MySQL service using following commands.



[root@sp /var/log]$ /etc/init.d/mysql stop
[root@sp /var/log]$ /etc/init.d/mysql start
	

If you want to keep your old files on the server for future use, then consider increasing the disk space on the server.

Step 4: This step is optional. Check free memory space using free -m. This command will show remaining memory on RAM in Megabytes.



[root@sp /var/log]$ free -m
             total       used       free     shared    buffers     cached
Mem:          4096        290       3805          0          0         72
-/+ buffers/cache:        218       3877
Swap:          512          0        512
	

This will give you the status of free RAM memory on the server.

References

MySQL Server Error Codes