How to Resolving MySQL Error Code ‘1146 Table Doesn’t exist’ in Easy Steps

Summary: This article provides the user with a comprehensive solution to a query like “MySQL error 1146 table does not exist” using manual and professional (MySQL Database Recovery) methods. Follow each of the steps discussed here to resolve MySQL ‘1146 The table does not exist errors in your SQL Server. Download Now   Purchase Now

MySQL database is a relational database system that contains tables, these tables are formally described and they contain data within them. The data could be accessed and modified in various ways and there is no need for changing the order of tables for it. Pretty cool, Isn’t it? But sometimes corruption or mishandling of the data can lead us to errors. Error 1146 in MySQL Table doesn’t exist is also one of those common errors which can take place during MySQL handling.

So, in this handout, I’ll elaborate MySQL Error 1146, the reason behind this error and how to resolve Bug? #1146 – Table ‘xxx.xxxxx’ doesn’t exist. So without wasting time, let’s get started.

Why Error 1146 in MySQL Takes Place?

There are multiple reasons and catalyst to this error. Some of the causes to error 1146 are stated below:

  • InnoDB crash and missing data files

As we all know that InnoDB is the transaction-safe (ACID compliant) storage engine for MySQL database, it offers multiple capabilities like Rollback, Commit and crash recovery for data of MySQL database. The InnoDB is also prone to corruption, so if it is not handled correctly there is a chance of crash of InnoDB. InnoDB is functional because of ibdata file and log file. It acts as a data dictionary to it. If by any reason these files go missing, there will be no chance of working InnoDB and MySQL will show you error 1146.

  • Improper directory accessing permissions

MySQL has a data storage directory where it stores all the database. Most of the time path is ‘/var/lib/mysql’. If the ownership and access permissions are not right and MySQL is not able to access this directory path then the error 1146 in MySQL will be shown.

  • Corruption in data tables

Tables of MySQL database can get corrupt due to several reasons like improper server shutdown, incomplete queries, user abuse, wrong formats, foreign key constraint error, etc. So if the table got corrupt the database can show MySQL error 1146.

  • .frm file missing 

.frm file contains the format and structure of the database. If anyhow this file is not copied to the database directory or it gets deleted then there will be an error message for error code 1146.

Methods to Fix MySQL ERROR 1146 table doesn’t exist

To fix Bug? #1146 – Table ‘xxx.xxxxx’ doesn’t exist, we can use multiple remedies and DIYs like:

Restore Backup

This is the best alternative you should use. It will surely recreate all the lost tables from the database and MySQL code 1146 will also get solved but keep in mind that there should be a backup file to restore. So always keep the habit of creating backup time to time, it’s a good practice. Also, it resolve MySQL ERROR 1146 table doesn’t exist after backup.

Restart the Server

Try to restart the server if any improper server shutdown took place. There is a chance to get it back in working condition and removing error code. So that user access MySQL without any issue

Repair Database Tables

You can repair database tables using MySQL CLI. All you need to do is to follow the stated steps:

1. Using SSH, log in to the server.

2. From the command line, execute the following command:

             mysql -u [username] -p

             Note: Replace username with your username and remove the brackets.

3. Now enter your password for the username.

4. Again enter the command:

             use [databasename];

             Note: provide the name of the database without brackets.

5. Now execute the following command:

             show tables;

6. Now repair table using following commands:

             (a) Check for tables with error:

                    check table [tablename];

             (b) Repair tables:

                    repair table [tablename];

7. Now quit using quit command.

Keep a copy of .frm file

You can keep a copy of .frm file and whenever the error 1146 arrises, you can paste the .frm file to the schema folder. It can fix error 1146.

Copy the ibdata file from backup

You should keep a copy of ibdata file as a backup so whenever the this MySQL error takes place you can paste it to the data directory of MySQL server.

Resolve MySQL ERROR 1146 table doesn’t exist using Professional Methods

If still, the error 1146 in MySQL takes place, you should go for a professional tool rather relying on the DIYs. You can use MySQL Data Recovery tool. It is the best tool to recover the corrupt tables and even fix MySQL ERROR 1146 table doesn’t exist after backup.

Watch this video tutorial for smooth use of MySQL Recovery Tool.

Conclusion

So, this is Error 1146 in MySQL ‘table doesn’t exist’. We discussed some quick remedies and DIYs to resolve this common MySQL error. It becomes really hard and disappointing when you face such errors cause these types of errors can lead you to lose all your valuable data.

Try your best and keeping the backup of data is the best precaution you can take. It will help you in such a critical situation to restore your MySQL database in the previous condition and it will also fix Bug? #1146 – Table ‘xxx.xxxxx’ doesn’t exist. So hope for the best and do it. Thanks fo reading this article. I hope you found it useful & interesting.

5/5 - (1 vote)

About The Author:

Mithilesh Tata is a technical expert who has assisted thousands of clients with Microsoft Outlook and other cloud-based email clients. He enjoys writing on email clients backup as well as email migration. He is always excited about giving troubled readers the most up-to-date knowledge, explanation, and user-friendly solutions.

Related Post