Brian Nettles
It's my blog and I share.


 

mysqldump: Got error: 1146: Table ‘databasename.tablename’ doesn’t exist when doing LOCK TABLES

Ran into this error tonight while copying tables from one database into another. 

I was using the mysqldump command as follows:

mysqldump -h localhost -u username -p --add-drop-table wildernessgear  wp_31_term_relationship /home/bnettles/wp_31_term_relationship.sql

This command was supposed to export just the one table wp_31_term_relationship.  I had already exported the 30 previous tables in the database.  All of a sudden this one was causing a problem with the following error message.

mysqldump: Got error: 1146: Table ‘wildernessgear.wp_31_term_relationship ‘ doesn’t exist when doing LOCK TABLES.

I searched the internet for a while and wasted a half an hour not being able to figure out how to unlock the tables.  Then I discovered the real problem.  The table did not exist.  There was a typo.  It was supposed to be wp_31_term_relationships with an “s” at the end, not wp_31_term_relationship.

Looks like Mysql is using the wrong error message in this case.

One Response to “mysqldump: Got error: 1146: Table ‘databasename.tablename’ doesn’t exist when doing LOCK TABLES”
  1. noname Says:

    > [...] Table ‘wildernessgear.wp_31_term_relationship ‘ doesn’t exist when doing LOCK TABLES.

    The error-msg cannot be more specific…. read it again ;)

Leave a Reply


Blog Information Profile for Supertramp678