LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 10: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, 10:58 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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-17-2009, 11:05 PM   #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



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 12:50 PM
MySQL:: backup entire databse but with selected tables structure only using mysqldump Swakoo Linux - General 1 11-07-2006 02:38 PM
Error when attempting backup with File Backup lglrgl Linux - Software 0 08-03-2006 10:38 AM
fatal error : can not open privilege tables mysql.host jayakrishnan Linux - Software 3 10-11-2005 08:49 AM
phpMyAdmin error: cannot browse tables, other functions work fine brandnewbie Linux - Software 4 01-08-2005 05:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:10 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration