創(chuàng)建外鍵怎么老是提示這個(gè)錯(cuò)誤呀 我感覺(jué)我代碼沒(méi)敲錯(cuò)啊
mysql> CREATE TABLE users(
??? -> id SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
??? -> username VARCHAR(10) NOT NULL,
??? -> pid SMALLINT UNSIGNED,
??? -> POREIGN KEY (pid) REFERENCES provinces (id)
??? -> );
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 'KEY (pid) REFERENCES provinces (id)
)' at line 5
mysql>
2017-10-16
佩服佩服
2017-09-23
已解決?? 原來(lái)是FOREIGN? 我寫(xiě)成了P```哎?