In our role as Support Engineers for web hosts, we manage servers with various services such as web, database, mail, control panels, FTP, etc.
MySQL is the most commonly used database server in Linux hosting and handling the databases and resolving the errors associated with it, is a common task that we perform.
A commonly noticed error in MySQL server is ‘1146 table doesn’t exist’. Today we’ll see what causes this ‘1146 table doesn’t exist’ error in MySQL and how to fix it.
Error : Table ‘mysql.innodb_index_stats’ doesn’t exist
status : Operation failed
What causes MySQL ‘1146 table doesn’t exist’ error
MySQL table errors happen due to many reasons, the major ones we’ve come across include:
- InnoDB crash – When the InnoDB server crash due to any process load or user abuse, or if the server was not restarted properly, it can get corrupt and cause table errors to show up.
- Missing ibdata file in the MySQL datadir – InnoDB has a data dictionary – the ibdata file and log files, which are crucial for InnoDB to function. If during migrations or restorations, these files go missing, it can prevent InnoDB tables from functioning right.
- Improperly placed .frm files – In InnoDB, tables have ‘.frm’ files that define the table format. If these files get deleted or were missed to copy over to the proper database directory, then the tables can show errors.
- Incorrect permissions and ownership of MySQL datadir – MySQL has a data directory, usually ‘/var/lib/mysql’ that stores the databases. If the permission and ownership of this directory is not adequate for MySQL to access it, errors would occur.
- Corrupt tables or improper table names – If the database tables got corrupt due to improper server shut down or incomplete queries, or if the table name format is not correct, the ‘1146 table doesn’t exist’ error may show up.
[ You don’t have to lose your sleep over server errors. Our expert server support specialists monitor & maintain your servers 24/7/365 and keep them rock solid. ]
How to fix MySQL ‘1146 table doesn’t exist’ error
Inorder to fix the error ‘1146 table doesn’t exist’, we adopt different techniques, after analyzing the root cause of the error.
- Restart MySQL server – If the error has happened due to improper server shut down or MySQL service related errors, we restart the service and check if it fixes the issue. If the service doesn’t start properly, we further investigate and fix the error.
- Repair the tables – MySQL has tools such as ‘myisamchk’ to repair corrupt databases and tables.
- Backup restore – Restoring database backups is the final resort to get the tables back to working condition. We always configure and maintain the backups in our customers’ servers up to date, inorder to ensure that there is no data loss or down time due to unexpected crashes or errors.
- Copy ibdata file – If the ‘ibdata’ file is missing, we copy it from the backup and restore it to the data directory for MySQL, after discarding the tablespace to avoid any corruptions or errors.
- InnoDB crash recovery – In case where the backup is incomplete or ibdata file is also corrupt, we’ve still been able to recover the tables via our expert crash recovery methods. Read the post ‘Database crash rescue‘ to know more.
[ Use your time to build your business. We’ll take care of your servers. Hire Our server experts to resolve and prevent server issues. ]
At Bobcares, our 24/7 Web Support Specialists constantly monitor all the services in the server and proactively audit the server for any errors or corruption in them.
With our systematic debugging approach for service or other software errors, we have been able to provide an exciting support experience to the customers.
If you would like to know how to avoid downtime for your customers due to errors or other service failures, we would be happy to talk to you.
Table ‘xterp_10.app_city’ doesn’t exist
this type of error camed my table..could not opened any datas…plz help me ..now what can i do?
Hi,
The issue could be due to corrupt or missing tables in your database. Please contact our support team at https://bobcares.com/contact-us/ if you still face issues. They’d help you resolve it.
The issue is that you need the ib* files in the root of the MySQL datadir (e.g. ibdata1, ib_logfile0 and ib_logfile1).
When I copied those it worked for me.
Hello, I have phpbb3. After downloading an extension called pages into the ext/ root, the forum crashed, I can’t open it. It says:
SQL ERROR [ mysqli ]
Table ‘id8315607_phpbb3.phpbb_pages’ doesn’t exist [1146]
SQL
I am a newbie at Mysql, so help me I want my forum back 🙁
export the database
delete the database in phpmyadmin
import the database back to phpmyadmin
create the lost table
Yes, these steps should work 🙂
By the way, this error may also occur when granting permissions to a user for a table that doesn’t exist.
Thank you for your inputs.
ERROR 1146 (42S02): Table ‘department.department’ doesn’t exist
Plzz help with this error
Hi,
The issue could be due to corrupt or missing tables in your database. We’ll be happy to talk to you on chat (click on the icon at right-bottom).
While i was creating triggers in mysql , the trigger was creating without showing any error but when i tried to insert data in a table , it showed an error ” 1146 , table ‘table_name.trigger_test’ doesn’t exist. Can you help me?
Hi,
Please contact our support team via live chat
my issue is
It keeps on concatenating this “app.” to my table name “tableName”. And the result is “app.tableName” which produces this error. “tableName” exist in the db but not “app.tableName”. How to resolve this?
Hi,
Our experts can help you with the issue.Please contact our support team via live chat(click on the icon at right-bottom).
wat to do when the tabel exist
but the data cant be enterded due to erro 1146
Hi,
Please contact our support through live chat(click on the icon at right-bottom).