Bobcares

How to resolve MySQL ‘1146 table doesn’t exist’ errors in your server

by | Jul 4, 2017

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.

  1. 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.
  2. Repair the tables – MySQL has tools such as ‘myisamchk’ to repair corrupt databases and tables.  
  3. 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.
  4. 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.
  5. 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.

 

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

16 Comments

  1. KAVIYARASU

    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?

    Reply
    • Reeshma Mathews

      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.

      Reply
  2. Rano

    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.

    Reply
  3. Levidro

    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 🙁

    Reply
  4. gejj

    export the database
    delete the database in phpmyadmin
    import the database back to phpmyadmin
    create the lost table

    Reply
    • Sijin George

      Yes, these steps should work 🙂

      Reply
  5. Ayo

    By the way, this error may also occur when granting permissions to a user for a table that doesn’t exist.

    Reply
    • Sijin George

      Thank you for your inputs.

      Reply
  6. Farhadul Zaman

    ERROR 1146 (42S02): Table ‘department.department’ doesn’t exist

    Plzz help with this error

    Reply
    • Maheen Aboobakkar

      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).

      Reply
  7. Monika

    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?

    Reply
    • Hiba Razak

      Hi,
      Please contact our support team via live chat

      Reply
  8. Jesse

    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?

    Reply
    • Hiba Razak

      Hi,
      Our experts can help you with the issue.Please contact our support team via live chat(click on the icon at right-bottom).

      Reply
  9. pooja

    wat to do when the tabel exist
    but the data cant be enterded due to erro 1146

    Reply
    • Hiba Razak

      Hi,
      Please contact our support through live chat(click on the icon at right-bottom).

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF