Search code examples
mysqlauto-incrementmysql-error-1064

1064 error for ALTER AUTO_INCREMENT


Please help, I would like for the table 'order' to auto increment starting at 14000, but no matter what I try, I keep getting the below error?

mysql> ALTER TABLE order AUTO_INCREMENT = 14000;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order AUTO_INCREMENT = 14000' at line 1

I have performed a number of searches and so far as I can tell this is the correct syntax.

Any help greatly appreciated.


Solution

  • Your table has named ORDER. But ORDER is a reserved word. Use ` and then the table name ORDER.

    In this way

    `order`