I want to make a column in my table auto-increment starting from the value 1001, not 1, but it's giving me an error when I try to set AUTO_INCREMENT = 1001
.
I created my column like this: ALTER TABLE users ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT, ADD INDEX (id);
And then I tried adding auto-increment from 1001 like this: ALTER TABLE users COLUMN id AUTO_INCREMENT=1001;
.
But it gave me the error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COLUMN id AUTO_INCREMENT=1001' at line 1
. And the value stayed at 1.
EDIT: I tried only ALTER TABLE clients AUTO_INCREMENT=1001
. While it doesn't give me any error, the value of the column stays 1.
EDIT 2: It worked now after I deleted the rows and added them again.