mysql语句错误以后的问题

来源:百度知道 编辑:UC知道 时间:2024/06/14 10:57:40
mysql> create table data (
-> id integer unsigned not null auto_increment,
-> title varchar(255) not null,
-> content text not null,
-> primary key('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 ''id')

)' at line 5

问题:
1、上面的语句是不是最后一句的ID上面不要加引号呀?
2、如果像上面输入了很长一串东西,最后说错误,那是不是必须全部重写啊?好麻烦哦!(虽然用方向键可以调处之前的语句,但是也是一条一条的)。

1、确实不需要那个引号,其实这个你根本无需问的,自己删除引号看看效果就知道。

2、执行这么长的语句,可以用记事本编写,保存为为*.SQL文件,在mysql>里面输入source xxx.sql执行。