Solved

mysqldump: Got error: 1066: Not unique table/alias: foo when using LOCK TABLES when lower_case_table_names=1

Posted on 2009-07-14
3
3,167 Views
Last Modified: 2012-06-27


I'm trying to dump a MYSQL DB on a linux server (Centos 5.2 32bit, MySQL 5.0.45)

In /etc/my.cnf the following value is defined:

[mysqld]
lower_case_table_names=1

When I try and do a dump with mysqldump I get the following error:

[root@linuxbox backups]# mysqldump --user=root --password=secret   --result-file=/tmp/out.sql--all-databases
mysqldump: Got error: 1066: Not unique table/alias: 'foo' when using LOCK TABLES

I can't figure out what I need to do to work around this, and we can't set lower_case_table_names to 0 in my.cnf because that will break some things that require case insensative table names.

How can I do a mysqldump in this situation? (or, another way to make a backup of the DB to file would work since that is the goal)
0
Comment
Question by:DrStalker
  • 2
3 Comments
 
LVL 14

Expert Comment

by:flob9
ID: 24847704
You can try to add specific settings in [mysqldump] section of the my.cnf.

Try also quote-names in the my.cnf :

[mysqldump]
quote-names
lower_case_table_names=0
0
 

Author Comment

by:DrStalker
ID: 24847795
That results in

mysqldump: unknown variable 'lower_case_table_names=0'

Which suggests to me mysqldump doesn't understand the lower_case_table_names variable.


0
 

Accepted Solution

by:
DrStalker earned 0 total points
ID: 24847868
Fixed this - the DB contained the tables "foo" and "FOO" which obviously is a problem when lower_case_table_names=1.  This had gone unnoticed until the dump because it was an unused table.

 
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PHP Apache application gives "Forbidden" message 5 45
join tables 4 51
Steps to produce a data strategy 5 43
How to update  and reset admin password for Linux 5 45
This article describes some very basic things about SQL Server filegroups.
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now