MySQL 5 migration issue auto_increment property goes missing

I was migrating a simple MySQL database from my PC to my Web server.

I was stuck when I could not add records to my table . MySQl threw a duplicate value for primary key error.

I was able to add records to my table in the local database in my PC though.

When I compared the two tables side by side , I found the auto_increment property missing in the remote table.

 remote table mysql 4.1.21

auto increment missing

 local table mysql 5.0.27-community-nt

auto increment present

Further investigation proved that the real culprit is PhpMyAdmin.

When you export a table along with the SQL compatiblity mode set to Mysql 4, it chops the auto_increment property.

phpmyadmin

Need to find a workaround for this, Or is it time to revert back to Mysql 4.1 on local or look of a Mysql 5.0 host

Published by

Varun Krish

Varun Krish has been dabbling with computers and websites for almost 2 decades. He has traveled to over 30 countries and hopes to visit every country on earth one day. He is currently the Editor-in-Chief of FoneArena.com and also advises startups and product companies on how to build better products. You can follow him on @varunkrish

Leave a Reply

Your email address will not be published.