我试图从mysql shell客户端运行下面的内容,并一直得到以下错误:ERROR: 1064: You have error in your SQL syntax; check manual corresponds to your MySQL server version for the right syntax to use near ')'at 1 line:
MySQL localhost:33060+ ssl plaything SQL > CREATE TABLE areas (id SERIAL PRIMARY KEY, area_name VARCHAR);
并一直得到以下错误: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 ')' at line 1.
我可能在哪里出了问题?
被yoss解决了。
试试这个: CREATE TABLE areas ( id int NOT NULL AUTO_INCREMENT, area_name varchar(255), PRIMARY KEY (id) )。
varchar没有在原语句中指定的字符数。