LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 08-17-2009, 11:54 PM   #1
ngohieutp
LQ Newbie
 
Registered: Dec 2006
Posts: 10

Rep: Reputation: 0
Backup - lock tables error


Hi. I want to backup my mysql databases. And I found this command to do it. But I received an error.

Code:
# mysqldump -u usernam -p --no-data database_name > \backups\structure.sql
Enter password: 
mysqldump: Got error: 1146: Table 'table_name' doesn't exist when using LOCK TABLES
#
Plese tell me why this happens ? How to resolve it ?
Thank you.
 
Old 08-17-2009, 11:58 PM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,311

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
Sounds like a DB corruption. Login to that particular db/schema and use 'show tables' then check if they all exist, specifically the one mentioned in the error msg.
 
Old 08-18-2009, 12:05 AM   #3
ngohieutp
LQ Newbie
 
Registered: Dec 2006
Posts: 10

Original Poster
Rep: Reputation: 0
I don't know, this is what I get :
Quote:
mysql> use vtv;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+-------------------------------+
| Tables_in_vtv |
+-------------------------------+
...
| cdr_1900561293_thongke |
| cdr_1900561293_thongke_200902 |
| cdr_1900561293_thongke_200903 |
| cdr_1900561293_thongke_200904 |

...
It means we have cdr_19001773_thongke_200902 table in vtv database.
Now :
Quote:
mysql> select * from cdr_1900561293_thongke_200902;
ERROR 1146 (42S02): Table 'vtv.cdr_1900561293_thongke_200902' doesn't exist
mysql>
And when I use backup command, It shows error like my question.
 
  


Reply

Tags
backup, mysql


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to lock tables when using mysqldump ? NaCo Programming 7 08-05-2009 01:50 PM
MySQL:: backup entire databse but with selected tables structure only using mysqldump Swakoo Linux - General 1 11-07-2006 03:38 PM
Error when attempting backup with File Backup lglrgl Linux - Software 0 08-03-2006 11:38 AM
fatal error : can not open privilege tables mysql.host jayakrishnan Linux - Software 3 10-11-2005 09:49 AM
phpMyAdmin error: cannot browse tables, other functions work fine brandnewbie Linux - Software 4 01-08-2005 06:04 PM


All times are GMT -5. The time now is 11:06 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration