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,100 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

758 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

17 Experts available now in Live!

Get 1:1 Help Now