[Solved] #1063 – Incorrect column specifier for column . . .

While adding auto increment value to one of the columns in my mysql database table, I got the error saying:

Error

SQL query:

ALTER TABLE `tablename`  ADD `id` VARCHAR(11) NOT NULL AUTO_INCREMENT  AFTER `userid`,  ADD   PRIMARY KEY  (`id`) ;

MySQL said: 

#1063 - Incorrect column specifier for column 'id' 

php-mysqlSolution

The error can easily be solved by changing the “type” of the column to INT (instead of VARCHAR which you’ve probably done).

Hopefully this solves your mysql error :) Happy coding!

2 comments on “[Solved] #1063 – Incorrect column specifier for column . . .

  1. it can be solved by removing the length e.g by default it shows 11 , so there is no need to assign length keep it bydefault.

Leave a Reply

Your email address will not be published.