<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: MySQL Error: 1062 Duplicate entry &#8217;0&#8242; for key 1</title>
	<atom:link href="http://blogs.vinuthomas.com/2008/06/18/mysql-error-1062-duplicate-entry-0-for-key-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.vinuthomas.com/2008/06/18/mysql-error-1062-duplicate-entry-0-for-key-1/</link>
	<description>A Tech Discovery Blog on PHP, Ajax, Security and Social Media.</description>
	<lastBuildDate>Thu, 13 Oct 2011 13:51:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Mallikarjun Anehosur</title>
		<link>http://blogs.vinuthomas.com/2008/06/18/mysql-error-1062-duplicate-entry-0-for-key-1/comment-page-1/#comment-42051</link>
		<dc:creator>Mallikarjun Anehosur</dc:creator>
		<pubDate>Fri, 30 Sep 2011 07:01:54 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=524#comment-42051</guid>
		<description>Got the solution by going through this blog in an minute ...
error: 1062 was   fixed by changing the field value to auto_increment ..could some one please give me this fix details ,why auto_increment ...in my case the filed was  primary key with int type ,so why the auto_increment.</description>
		<content:encoded><![CDATA[<p>Got the solution by going through this blog in an minute &#8230;<br />
error: 1062 was   fixed by changing the field value to auto_increment ..could some one please give me this fix details ,why auto_increment &#8230;in my case the filed was  primary key with int type ,so why the auto_increment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: شات حائل</title>
		<link>http://blogs.vinuthomas.com/2008/06/18/mysql-error-1062-duplicate-entry-0-for-key-1/comment-page-1/#comment-42003</link>
		<dc:creator>شات حائل</dc:creator>
		<pubDate>Wed, 24 Aug 2011 01:38:14 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=524#comment-42003</guid>
		<description>thanks for sole</description>
		<content:encoded><![CDATA[<p>thanks for sole</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mamta</title>
		<link>http://blogs.vinuthomas.com/2008/06/18/mysql-error-1062-duplicate-entry-0-for-key-1/comment-page-1/#comment-41397</link>
		<dc:creator>mamta</dc:creator>
		<pubDate>Sat, 23 Apr 2011 15:36:01 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=524#comment-41397</guid>
		<description>thanks a lot i ws really fix with this error and i tried the suggestion posted here as set the id for bigint and i got my solution.</description>
		<content:encoded><![CDATA[<p>thanks a lot i ws really fix with this error and i tried the suggestion posted here as set the id for bigint and i got my solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: badr</title>
		<link>http://blogs.vinuthomas.com/2008/06/18/mysql-error-1062-duplicate-entry-0-for-key-1/comment-page-1/#comment-41013</link>
		<dc:creator>badr</dc:creator>
		<pubDate>Thu, 24 Feb 2011 01:03:09 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=524#comment-41013</guid>
		<description>i got the problem. just edit the id field to auto-increment fixed the problem.thnQ 4 the post.</description>
		<content:encoded><![CDATA[<p>i got the problem. just edit the id field to auto-increment fixed the problem.thnQ 4 the post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tango</title>
		<link>http://blogs.vinuthomas.com/2008/06/18/mysql-error-1062-duplicate-entry-0-for-key-1/comment-page-1/#comment-40954</link>
		<dc:creator>Tango</dc:creator>
		<pubDate>Fri, 28 Jan 2011 09:20:47 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=524#comment-40954</guid>
		<description>Thanks for that solution.
It fixed the problem...</description>
		<content:encoded><![CDATA[<p>Thanks for that solution.<br />
It fixed the problem&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vinuthomas</title>
		<link>http://blogs.vinuthomas.com/2008/06/18/mysql-error-1062-duplicate-entry-0-for-key-1/comment-page-1/#comment-40527</link>
		<dc:creator>vinuthomas</dc:creator>
		<pubDate>Mon, 26 Jul 2010 11:07:29 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=524#comment-40527</guid>
		<description>What I meant was, if you&#039;re using for example, an INT field, make sure that the maximum value of an int (2147483647) hasn&#039;t been reached, or 4294967295 for unsigned INT. If the value in the field has reached the maximum the field can support, it&#039;ll reset back to 0</description>
		<content:encoded><![CDATA[<p>What I meant was, if you&#39;re using for example, an INT field, make sure that the maximum value of an int (2147483647) hasn&#39;t been reached, or 4294967295 for unsigned INT. If the value in the field has reached the maximum the field can support, it&#39;ll reset back to 0</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fafff</title>
		<link>http://blogs.vinuthomas.com/2008/06/18/mysql-error-1062-duplicate-entry-0-for-key-1/comment-page-1/#comment-40526</link>
		<dc:creator>Fafff</dc:creator>
		<pubDate>Fri, 23 Jul 2010 19:59:27 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=524#comment-40526</guid>
		<description>check if your autoincrement field has maxed the datatype for that field.&lt;br&gt;(what this mean?i don&#039;t understand it)</description>
		<content:encoded><![CDATA[<p>check if your autoincrement field has maxed the datatype for that field.<br />(what this mean?i don&#39;t understand it)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Botnix</title>
		<link>http://blogs.vinuthomas.com/2008/06/18/mysql-error-1062-duplicate-entry-0-for-key-1/comment-page-1/#comment-40494</link>
		<dc:creator>Botnix</dc:creator>
		<pubDate>Tue, 20 Apr 2010 19:55:24 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=524#comment-40494</guid>
		<description>I also solved this error by editing the id field to auto increment, in phpmyadmin there is a check box A_I which can be checked to make sure the id increments.</description>
		<content:encoded><![CDATA[<p>I also solved this error by editing the id field to auto increment, in phpmyadmin there is a check box A_I which can be checked to make sure the id increments.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dunghoangit</title>
		<link>http://blogs.vinuthomas.com/2008/06/18/mysql-error-1062-duplicate-entry-0-for-key-1/comment-page-1/#comment-40416</link>
		<dc:creator>dunghoangit</dc:creator>
		<pubDate>Thu, 04 Feb 2010 02:15:54 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=524#comment-40416</guid>
		<description>try this

REPAIR TABLE your_tbl_error QUICK ;

:)</description>
		<content:encoded><![CDATA[<p>try this</p>
<p>REPAIR TABLE your_tbl_error QUICK ;</p>
<p> <img src='http://blogs.vinuthomas.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Md. Iqbal Hosan</title>
		<link>http://blogs.vinuthomas.com/2008/06/18/mysql-error-1062-duplicate-entry-0-for-key-1/comment-page-1/#comment-39752</link>
		<dc:creator>Md. Iqbal Hosan</dc:creator>
		<pubDate>Tue, 10 Mar 2009 13:01:31 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=524#comment-39752</guid>
		<description>i got the problem. just edit the id field to auto-increment fixed the problem.thnQ 4 the post.</description>
		<content:encoded><![CDATA[<p>i got the problem. just edit the id field to auto-increment fixed the problem.thnQ 4 the post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://blogs.vinuthomas.com/2008/06/18/mysql-error-1062-duplicate-entry-0-for-key-1/comment-page-1/#comment-39692</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Wed, 21 Jan 2009 03:13:08 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=524#comment-39692</guid>
		<description>Thanks for posting this -- I was really puzzled with this error. I changed the data type to BIGINT and reloaded the data and it worked. -Joe</description>
		<content:encoded><![CDATA[<p>Thanks for posting this &#8212; I was really puzzled with this error. I changed the data type to BIGINT and reloaded the data and it worked. -Joe</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajay</title>
		<link>http://blogs.vinuthomas.com/2008/06/18/mysql-error-1062-duplicate-entry-0-for-key-1/comment-page-1/#comment-39646</link>
		<dc:creator>Ajay</dc:creator>
		<pubDate>Tue, 23 Dec 2008 11:36:01 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=524#comment-39646</guid>
		<description>Hi,
I found your site very helpful. While inserting data into a table I again and again got this error &quot;Duplicate entry ‘0′ for key 1&quot; and I was surprised where the error is ? When I searched this problem on google, I found solution on your  site and fixed the error within seconds.
Thanks a lot for posting solutions.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I found your site very helpful. While inserting data into a table I again and again got this error &#8220;Duplicate entry ‘0′ for key 1&#8243; and I was surprised where the error is ? When I searched this problem on google, I found solution on your  site and fixed the error within seconds.<br />
Thanks a lot for posting solutions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darren</title>
		<link>http://blogs.vinuthomas.com/2008/06/18/mysql-error-1062-duplicate-entry-0-for-key-1/comment-page-1/#comment-39602</link>
		<dc:creator>Darren</dc:creator>
		<pubDate>Sun, 30 Nov 2008 18:54:19 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=524#comment-39602</guid>
		<description>I had the same problem when using the INSERT function to enter data into an already populated table, I just had to set the primary key as Id, and set it to auto_increment,

Another reason why this could happen is the data type, check if you&#039;re using TINYINT or INT</description>
		<content:encoded><![CDATA[<p>I had the same problem when using the INSERT function to enter data into an already populated table, I just had to set the primary key as Id, and set it to auto_increment,</p>
<p>Another reason why this could happen is the data type, check if you&#8217;re using TINYINT or INT</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony</title>
		<link>http://blogs.vinuthomas.com/2008/06/18/mysql-error-1062-duplicate-entry-0-for-key-1/comment-page-1/#comment-39456</link>
		<dc:creator>Tony</dc:creator>
		<pubDate>Thu, 07 Aug 2008 15:15:43 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=524#comment-39456</guid>
		<description>I have the same problem, out of the blue got this error&quot;
:Duplicate entry &#039;4853&#039; for key 1
and I am using &quot;int&quot; as the data type. changing it to bigint may resolve things by resetting the autoincrement for the time being, but I expect it will surface again sometime. There is some other cause for this

Also, it seems not a good idea to use bigint because extra disk space use  ref:  http://ronaldbradford.com/blog/bigint-v-int-is-there-a-big-deal-2008-07-18/</description>
		<content:encoded><![CDATA[<p>I have the same problem, out of the blue got this error&#8221;<br />
 <img src='http://blogs.vinuthomas.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> uplicate entry &#8217;4853&#8242; for key 1<br />
and I am using &#8220;int&#8221; as the data type. changing it to bigint may resolve things by resetting the autoincrement for the time being, but I expect it will surface again sometime. There is some other cause for this</p>
<p>Also, it seems not a good idea to use bigint because extra disk space use  ref:  <a href="http://ronaldbradford.com/blog/bigint-v-int-is-there-a-big-deal-2008-07-18/" rel="nofollow">http://ronaldbradford.com/blog/bigint-v-int-is-there-a-big-deal-2008-07-18/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vinu</title>
		<link>http://blogs.vinuthomas.com/2008/06/18/mysql-error-1062-duplicate-entry-0-for-key-1/comment-page-1/#comment-38248</link>
		<dc:creator>vinu</dc:creator>
		<pubDate>Fri, 11 Jul 2008 18:33:27 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=524#comment-38248</guid>
		<description>Thanks for pointing that out Afrasyab. So this situation could happen when the auto-increment count goes wrong for some reason.</description>
		<content:encoded><![CDATA[<p>Thanks for pointing that out Afrasyab. So this situation could happen when the auto-increment count goes wrong for some reason.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Afrasyab Bashir</title>
		<link>http://blogs.vinuthomas.com/2008/06/18/mysql-error-1062-duplicate-entry-0-for-key-1/comment-page-1/#comment-38144</link>
		<dc:creator>Afrasyab Bashir</dc:creator>
		<pubDate>Thu, 10 Jul 2008 18:42:24 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.vinuthomas.com/?p=524#comment-38144</guid>
		<description>Above normally means that there already exists an entry in the database that already has the value which autoincrement is trying to initialise with. So if duplicate entry &#039;0&#039; is there then probably auto_increment value is trying to initialise with 0. I received the error duplicate entry &#039;1&#039; for key 1, which strangely meant that the column already have a value 0 which the auto_increment index was trying to initialise. I had to change this value to the last value then changed the column to cater for auto_increment then re-initalise the counter to the last value and then revert the last value of my column back to it&#039;s beginning value i.e. 0. (am i confusing you? ;)</description>
		<content:encoded><![CDATA[<p>Above normally means that there already exists an entry in the database that already has the value which autoincrement is trying to initialise with. So if duplicate entry &#8217;0&#8242; is there then probably auto_increment value is trying to initialise with 0. I received the error duplicate entry &#8217;1&#8242; for key 1, which strangely meant that the column already have a value 0 which the auto_increment index was trying to initialise. I had to change this value to the last value then changed the column to cater for auto_increment then re-initalise the counter to the last value and then revert the last value of my column back to it&#8217;s beginning value i.e. 0. (am i confusing you? <img src='http://blogs.vinuthomas.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced
Database Caching 1/28 queries in 0.025 seconds using disk: basic
Object Caching 483/528 objects using disk: basic

Served from: blogs.vinuthomas.com @ 2012-02-09 04:28:55 -->
