我使用MySQL命令行Client8.0并多次出现此错误。我检查了我的表的名称是否与我的数据库的名称匹配并更正了它。我重新打开了MySQL,但也出现了同样的错误。我用许多不同的方法重写了这句台词,但都没有用。我不明白这是怎么回事。将感谢帮助和纠正我的错误。
mysql> create table StudentInfo (Roll_No integer primary key, Name varchar, Student_Address varchar, Phone varchar, Age integer);
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 ', Student_Address varchar, Phone varchar, Age integer)' at line 1
在varchar中输入长度
ex-:创建表StudentInfo(Roll_No integer主键,Name varchar(255),Student_Address varchar(255),Phone varchar(255),Age integer);