0
我試圖做簡單的數據庫,因爲昨天與AUTO_INCREMENT選項主要ID爲關鍵,但不斷收到此錯誤:MySQL的AUTO_INCREMENT列創建
Executing:
CREATE TABLE `spring`.`samochod` (
`idsamochod` INT NOT NULL DEFAULT AUTO_INCREMENT,
PRIMARY KEY (`idsamochod`));
Operation failed: There was an error while applying the SQL script to the database.
ERROR 1064: 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 'AUTO_INCREMENT,
PRIMARY KEY (`idsamochod`))' at line 2
SQL Statement:
CREATE TABLE `spring`.`samochod` (
`idsamochod` INT NOT NULL DEFAULT AUTO_INCREMENT,
PRIMARY KEY (`idsamochod`))
ERROR 1064: 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 'AUTO_INCREMENT,
PRIMARY KEY (`idsamochod`))' at line 2
SQL語句:
CREATE TABLE `spring`.`samochod` (
`idsamochod` INT NOT NULL DEFAULT AUTO_INCREMENT,
PRIMARY KEY (`idsamochod`))
我得到甚至對於正常的整數列也是如此。我已經閱讀過很多文章,據我所知,它應該以這種方式工作,沒有任何問題。
有人能告訴我我做錯了什麼嗎?
你爲什麼標籤mysql的**和**的SQL服務器上,當你的問題是關於MySQL的? –
你爲什麼認爲這可能是有效的語法 – Strawberry