Page 1 of 1

Duplicate Entry 0 for Key 1 [SOLVED]

Posted: Mon Aug 20, 2007 10:17 pm
by dancurranjr
I recently moved Devils Canyon Brewery to a new server, exported the old sql and reimported at the new location.

Whenever I post a new article it will not show up on the front page. The key in the table is at 0 so I have to use the sql interface and go in and manually change it to the next number (86, 87, etc).
d
Now I noticed that people cannot register:

mosuser::store failed
Duplicate entry \'0\' for key 1 SQL=INSERT INTO jos_users ( `id`,`name`,`username`,`email`,`password`,`gid`,`registerDate` ) VALUES ( . . . . . . )

Its almost like the database ddoesn't know it has records and is trying to start from scratch.  Any help greatly appreciated.

Re: Duplicate Entry 0 for Key 1

Posted: Sun Aug 26, 2007 5:25 pm
by pe7er
Use phpMyAdmin to check the table.

jos_users should have an "Next Autoindex" which should be the next ID that can be used.
With the "Operations" tab you'll get a form where you can increase the "auto_increment".

(PS: before making any changes it's recommended to backup your database).

Re: Duplicate Entry 0 for Key 1

Posted: Sun Aug 26, 2007 11:27 pm
by dancurranjr
Thanks, You got me pointed in the right direction.

Here is whats happening now.

I made a copy of jos_users  --> jos_usersORIGINAL
and jos_comprofiler  --> jos_comprofilerORIGINAL

So I am not working on the "masters"

Deleted Key 0 in both.

Went to OPERATIONS page of both and at the bottom under AutoIncrement enterd 584 (the next number)

This would let me go to the registration page and register a new member but then checking th tables the ID number was 0 again

Like I said though, you got me in the right directions - the ANSWER was to go to the STRUCTURE tab, select the ID, tell it the next number was 584 and then AUTO INCREMENT.

Did that to both tables - Wallah! Ta Da!

Then when one goes back to the OPERATIONS page youll see 584 in the bottom auto increment.

So that will help on a few random errors I have been receiving. Thank you for responding to this post. I hope my reply helps someone else!

Re: Duplicate Entry 0 for Key 1

Posted: Mon Aug 27, 2007 7:35 am
by pe7er
You're welcome! Good to read that you've solved that problem!

PS: Could you please mark your first message in this thread as "solved" ? (Modify the first message and choose the Message Icon [solved] Image).
This way the list of messages shows that the question has been solved, and other users can benefit from it.
Thanks!

Re: Duplicate Entry 0 for Key 1

Posted: Mon Aug 27, 2007 10:02 pm
by dancurranjr
Ok . . . .  I'm not seeing a message solved icon in the first message. . .

Re: Duplicate Entry 0 for Key 1 [SOLVED]

Posted: Sat Jul 16, 2011 6:41 pm
by jnba
You guys are awesome.. after days.. of searching this did it .. although i couldnt find it searching here had to google it and redirect here..anyways even though this is a 5 year old post it worrked perfecto!

thanks,

John

Re: Duplicate Entry 0 for Key 1 [SOLVED]

Posted: Sat Jul 16, 2011 8:09 pm
by jnba
jnba wrote:You guys are awesome.. after days.. of searching this did it .. although i couldnt find it searching here had to google it and redirect here..anyways even though this is a 5 year old post it worrked perfecto!

thanks,

John

Correction.. it worked but the users are not listed in User manager..no im lost again..

any ideas..?

Re: Duplicate Entry 0 for Key 1 [SOLVED]

Posted: Sun Jul 17, 2011 6:45 pm
by jnba
jnba wrote:
jnba wrote:You guys are awesome.. after days.. of searching this did it .. although i couldnt find it searching here had to google it and redirect here..anyways even though this is a 5 year old post it worrked perfecto!

thanks,

John

Correction.. it worked but the users are not listed in User manager..no im lost again..

any ideas..?
Update... in order to get this working i had to manually back up my local database and upload it to the live server.. now its working perfectly, i do not know the reasons for this but hopefully in the future someone will post a perm fix .. thanks all.

Re: Duplicate Entry 0 for Key 1 [SOLVED]

Posted: Sat Jun 27, 2015 9:09 am
by sunshine1688
I just saw the same problem on Joomla 3, but after force refreshed the page, thing going to normal.