How to Fix MySQL Error 1030: Got Error 127 from Storage Engine?
Summary: The Error 1030: Got error 127 from storage engine in MySQL can occur due to database corruption or any other reason. In this post, we will see how to fix this error using native tools in MySQL Server. We will also mention a dedicated MySQL database recovery tool that can easily repair the corrupt MySQL database and help fix the error.
The error 1030, also called ER_GET_ERRNO, is an error related to the storage engine, which is the software component used by MySQL to access data from the database. The storage engine component reads, modifies, or deletes data from the database. MySQL includes two different storage engines – MyISAM and InnoDB. The latter is the default engine from version 8 of MySQL.
When reading or writing the data, you may get the following error:
Error: 1030 SQLSTATE: HY000 (ER_GET_ERRNO)
Message: Got error %d from storage engine
To get the complete error description, you can use the following command from the shell:
The response will be like:
Error code 127: Record-file is crashed.
It looks there is a corruption issue.
Let’s see how to fix this error.
How to Fix MySQL Error 1030?
MySQL provides commands to check and repair corrupted tables. Let’s see how to verify if a table is corrupted.
To check if a table is corrupted, use the command CHECK TABLE as given below.
CHECK TABLE <NAME_OF_THE_MYISAM_TABLE> [ , table2, table3, ..][option]
The ‘Option’ parameter can have the values, such as FOR UPGRADE, QUICK, FAST, MEDIUM, EXTENDED, or CHANGED.
CHECK TABLE <NAME_OF_THE_MYISAM> FAST QUICK;
The MyISAMCHK command provides information about a table when the engine used is MyISAM.
This is the syntax:
MyISAMCHK [option] < NAME_OF_THE_MYISAM_TABLE>
Specify the –recover (or –r) option to perform data repair in the table. It will fix any problem, except problems related to unique key.
MyISAMCHK –r <NAME_OF_THE_MYISAM_TABLE>
Repeat the same procedure for all the corrupt tables. Stop the MySQL service before executing data repair.
If there are many damaged tables, the repair operation becomes lengthy, increasing the chances of mistakes while performing the operation. Due to this, the MyISAMCHK command may fail.
At this point, it may be useful to use a tool developed specifically for MySQL database recovery.
I suggest using Stellar Repair for MySQL. This tool, developed by Stellar, is very effective in repairing corrupted tables and database. It is also easy-to-use.
Key features of this powerful software are:
- Repairs corrupt MySQL database
- Repairs MySQL database tables of both the storage engines – InnoDB and MyISAM
- Repairs MySQL and MariaDB databases created on Windows and Linux
- Fixes all types of MySQL corruption errors
- Saves repaired files in several format – MySQL, MariaDB, SQL Script, CSV, HTML, and XLS
Steps to use Stellar Repair for MySQL:
- Download Stellar Repair for MySQL from the Stellar’s official website.
- Choose whether you want to download the Windows version or the Linux version.
- Press the Free Download button.
- Once downloaded, install the application by following the setup wizard.
- When you launch the software, you’ll be asked to select a database to repair.
- Enter the path to the folder that contain database files. Press the OK button.
- A dialog box will appear, if data files are in use. In this case, stop the MySQL Service and then start the recovery process again.
- A dialog box shows the list of available databases. Choose the database file(s). Press the Repair button.
- The tool will start scanning and repairing the database.
- When the database is repaired, a Repair Complete dialog box will appear.
- Now, press the Save button.
- Choose the format to save your data. By default, the selected format is MySQL. You can also choose from other formats, such as Maria DB, HTML, SQL Script, CSV, and XLS.
- Enter host name, username, and password. Then, press the Save button.
- When the process is finished, a Save Complete dialog box appears. Click OK.
In this post, we have discussed in detail the MySQL error 1030: Got error 127 from storage engine. We have also mentioned the step-by-step process to fix this error using the MySQL MyISAMChk command. In case the MySQL repair command doesn’t work, you can use a dedicated MySQL database recovery tool, such as Stellar Repair for MySQL to repair the corrupt database and fix the error.