• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3827
  • Last Modified:

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

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:


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)
  • 2
1 Solution
You can try to add specific settings in [mysqldump] section of the my.cnf.

Try also quote-names in the my.cnf :

DrStalkerAuthor Commented:
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.

DrStalkerAuthor Commented:
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now