在命令提示符下使用MySQL,创建表时出现ERROR 1064 (42000)
我正在使用xampp。
创建数据库后,
CREATE DATABASE University + use University
我通过键入
CREATE TABLE Student
(
SNo INT NOT NULL,
SName VARCHAR(16) NOT NULL,
SAge INT NOT NULL,
SDepartment ENUM('CS', 'EE', 'Math', 'Physics') NOT NULL,
PRIMARY KEY (SNo)
);
But 发出一声蜂鸣声来创建表,并
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 'use University
CREATE TABLE Student
(
SNo INT NOT NULL,
Sname VARCHAR(16) NOT NULL,
SAg'
at line 2
显示在命令提示符中。但我不知道这种情况下的语法错误是什么。
I am using xampp.
After creating a database
CREATE DATABASE University + use University
I create table by typing
CREATE TABLE Student
(
SNo INT NOT NULL,
SName VARCHAR(16) NOT NULL,
SAge INT NOT NULL,
SDepartment ENUM('CS', 'EE', 'Math', 'Physics') NOT NULL,
PRIMARY KEY (SNo)
);
But a beep is resulted and
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 'use University
CREATE TABLE Student
(
SNo INT NOT NULL,
Sname VARCHAR(16) NOT NULL,
SAg'
at line 2
is shown in command prompt. But I don't know what the syntax error is in this case.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为
+
给你带来了语法错误。尝试摆脱它以将它们分成两个语句I think the
+
is giving you syntax error. Try getting rid of it to separate these into two statements