[prog] mysqldump and duplicate column names

Rachel McConnell rachel at xtreme.com
Tue Sep 20 07:37:48 EST 2005


Hi Nicki,

> ERROR 1060 (42S21) at line 128: Duplicate column name 'id'

Can you send line 128?

You are right that same-named columns in different tables pose no
difficulty, except in badly written join statements.  However, the error
"Duplicate column name" isn't the error you'd get from a bad join
statement, it does mean that there's an attempt to add a column that has
the same name as an existing one.

There's apparently a bug in MySQL 5.0.8 that produces this error when a
particular command is run - the bug is that the error is displayed, but
it can be ignored.  dunno if this applies to earlier versions though,
nor to your specific case.  http://bugs.mysql.com/bug.php?id=11372

Rachel


On Mon, 19 Sep 2005 15:36:07 -0400, "Nicki Handy"
<nicki at virtualnicki.com> said:
> Hi- I am trying to restore a database from a backup created by 
> mysqldump - I get an error that there is a duplicate column. But there 
> should be duplicate columns in separate tables. I mean, that's where my 
> joins are. So "id" in one table and "id" in another should be 
> acceptable as long as they are in different tables right? So, I get:
> ERROR 1060 (42S21) at line 128: Duplicate column name 'id'
> 
> I didn't name those columns in actuality- I'm just trying to do the 
> restore. I am restoring from mysql 3.23 to 4.1
> 
> Thanks
> Nicki


More information about the Programming mailing list