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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

785 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