[prog] ] Re: mysqldump and duplicate column names

Nicki Handy nicki at virtualnicki.com
Wed Sep 21 07:43:00 EST 2005


Yeah, I corrected all the instances of it, but now I am having a 
problem with the auto_increment. I can't get it to start on 0, it 
starts on 1 for some reason. When I create all the tables and then 
alter them, I get errors too that the syntax is wrong. I think it's an 
incorrect error b/c I've checked all the docs and tried lots of 
different ways of altering the table to get the column 
auto_incremented. It's a bit of a mess. But that seems like a bigger 
problem than the original.

I also tried adding to the create statement- Create table tablename (id 
int(11) NOT NULL auto_increment=0)
but that doesn't work- incorrect syntax.
And even if I did get it starting at 0, it would add 1 to get to 1 for 
the first one anyway. I need it to start at -1 which fails, syntax 
error.

If I could get the alter table working, that would probably be the best 
method, I could take it out of the create statement, populate the 
tables and then alter the table afterwards. I don't need to do this 
regularly- just once or twice so I don't even need to write a script 
that will work every time.
Thanks
Nicki

On Sep 20, 2005, at 5:18 PM, Rachel McConnell wrote:

> Yep, you got it, that's exactly the problem.  Do the other tables use 
> that syntax too?  If so, it seems likely that the difference in 
> version is the issue - MySQL may have changed its syntax between 3.x 
> and 4.x (i forget the exact versions you mentioned).  If just one 
> table is doing it, that is a mysterious problem that I don't have any 
> ideas about :(
>
> It seems you need to make this dump & restore more than just once?  If 
> the MySQL documentation & Google (& other Chix) don't have an answer, 
> and the schema isn't constantly changing, I might consider hacking a 
> Perl or Python script into the process to check for & remove the 
> duplicate field.  Ugly, but it might work...
>
> Sorry not to be of more help!
>
> Rachel
>
> Nicki Handy wrote:
>> Ahh...
>> I took out one of the Primary Key parameters- so it just says Primary 
>> Key (id) and that worked. So, I'm confused- obviously, I have the 
>> wrong syntax for Primary Key however, it's mysqldump that is creating 
>> it. Anyone know how to get it to stop doing that?
>> PRIMARY KEY (id,id)
>> why is it doing that?
>> THanks
>> On Sep 20, 2005, at 10:07 AM, Nicki Handy wrote:
>>> Maybe what I need to do is downgrade mysql. Does anyone know what 
>>> version I should be using and how to get off of the one I'm on? I'm 
>>> going from 3.23 to 4.1.10a
>>> Is that a problem? So mysqdumping from the 3.23 and trying to import 
>>> into 4.1.10 is what I'm doing. It's only running create table 
>>> statements and inserts though. But I can't think of anything else I 
>>> could do.
>>>
>>> Nicki
>>>
>>>
>>> _______________________________________________
>>> Programming mailing list
>>> Programming at linuxchix.org
>>> http://mailman.linuxchix.org/mailman/listinfo/programming
>>>
>> _______________________________________________
>> Programming mailing list
>> Programming at linuxchix.org
>> http://mailman.linuxchix.org/mailman/listinfo/programming
>



More information about the Programming mailing list