[Err] 1064 - You have an error in your SQL syntax?

[Err] 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 'create table Goods
(
   goods_id             int not null auto_increment,
   ' at line 3
[Err] select * from user ;

select * from user where user_name='xiaoming' and user_pass='pass1'

create table Goods
(
   goods_id             int not null auto_increment,
   brand_id             int,
   goods_name           text,
   is_special           varchar(10),
   goods_price          decimal(10,2),
   goods_off_price      decimal(10,2),
   goods_description    text,
   goods_image_path     text,
   primary key (goods_id)
);

insert into brand(brand_name) values('IPhone'),('Samsung'),('Mi'),('Nokia') ;

select * from brand ;

insert into goods(brand_id,goods_name,is_special,goods_price,goods_off_price,
goods_description,goods_image_path)
values(1,'IPhone 5','true',1000,800,'IPhone 5','/images/iphone.png'),
(2,'galaxy-note','true',1200,900,'galaxy-note','/images/galaxy-note.jpg'),
(3,'Mi Mix','false',1500,1000,'Mi Mix','/images/Z1.png'),
(4,'Nokia 9','false',1300,1000,'Nokia 9','/images/galaxy-s4.jpg');

select * from goods ;

select * from cart ;

select last_insert_id() ; 

select * from cart where user_id=3;

select * from cart_goods 

select g.*,cg.goods_qty  from cart_goods cg,goods g 
 where cart_id=(select cart_id from cart where user_id=3) )
[Msg] Finished - Unsuccessfully
--------------------------------------------------

sql语法有错误,你不要一次性执行这么多。分多次执行

参考下 CREATE TABLE `user_t` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_name` varchar(40) NOT NULL, `password` varchar(255) NOT NULL, `age` int(4) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

您好,我是有问必答小助手,您的问题已经有小伙伴解答了,您看下是否解决,可以追评进行沟通哦~

如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~

ps:问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>>https://vip.csdn.net/askvip?utm_source=1146287632

没看不出什么问题,检查一下有没有中文的空格,括号,逗号之类的字符。