473,503 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Duplicate column name" error when adding column

I have two identical databases running on two separate servers. I want
to add a column to the following table:

classified_cats { acid , name , parent }

Running
ALTER TABLE `classified_cats` ADD `is_active` TINYINT( 1 ) DEFAULT '0'
NOT NULL ;
on server A works fine, so I know the SQL is correct. Running the same
query on server B results in the following error:
Duplicate column name 'acid'.

The show create table SQL for server A is as follows:
CREATE TABLE `classified_cats` ( `acid` int(11) NOT NULL
auto_increment, `name` varchar(255) NOT NULL default '', `parent`
int(11) NOT NULL default '0', PRIMARY KEY (`acid`) ) ENGINE=MyISAM
DEFAULT CHARSET=latin1

The show create table SQL for server B is as follows:
CREATE TABLE `classified_cats` ( `acid` int(11) NOT NULL
auto_increment, `name` varchar(255) NOT NULL default '', `parent`
int(11) NOT NULL default '0', PRIMARY KEY (`acid`,`acid`) )
ENGINE=MyISAM DEFAULT CHARSET=latin1

Note the difference in PRIMARY KEY - I'm not sure what (`acid`,`acid`)
means.

Any ideas on how to overcome this?

TIA

Andy

Jan 12 '06 #1
1 9943
Found a solution:
1) Dump the table.
2) Recreate with the SQL corrected to ...PRIMARY KEY(`acid`)
3) Source the dump.

Then the ALTER TABLE statement works as expected.

Think it was a problem due to server B being upgraded to MySQL 5.0.

Andy

Jan 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1633
by: susanwinchell | last post by:
I have a table with only two columns (created from query of a much larger database). The first column contains many "duplicate" names or ID, and the second column contains values which need to be...
3
4466
by: Steve N. | last post by:
I was adding some new files to a project and changed a few options, now when I compile I get "'MessageBoxA' : is not a class or namespace name" on this line (and many others like it):...
2
3375
by: Antanas | last post by:
I applied FP9a on top DB2 UDB 8 FP8. Now I notice in Control Center to get this error: CLI0611E Invalid column name. SQLSTATE=S0022 when I slelect any table then Show Related->Tables Spaces. Is...
2
1870
by: athos | last post by:
Dear All, Our project was done in SQL 2000, now we are migrating to 2005. however, there are lots of command such as: a) SELECT * FROM myTableName which, shall be b) SELECT * FROM...
0
1151
by: postings | last post by:
Hi Microsoft need to reopen this bug... http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=f4c529ae-4879-41a0-9f24-984923f20999 Visual Studio 2005 Pro (final) has...
6
14352
by: crs27 | last post by:
Hai, Im getting this error.There is a column by name "nr_first_name" in the table "gistl_new_request". Yet im getting as that dose not exist.Would like to now what is the cause of it. ...
0
1558
by: UT-BadBoy | last post by:
Hi, I've been working with ASP.NET for about a year so I'm still considering myself to be somewhat of a novice in this field. I am receiving this particualr error when trying to hit a...
5
1631
by: Chris Botha | last post by:
There is a database table with one of the columns named "System". When creating a new Dataset for this table, the project gives a huge number of compile errors. If I change the column name to be...
1
8580
by: JaganMohanRao | last post by:
i have create a table and inserted a values init. when i am getting the values it is throwing the exception "ERROR: column "dtype" of relation "xxxx" does not exist" where xxxx is table name. if...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7348
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5592
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5021
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4685
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3166
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
397
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.