a.sql的内容为:
#--create database if not exists an older one
create database if not exists JudgeOnlineuse JudgeOnline#--create problem table contain all the problem information
create table if not exists Problem
(
problem_id int(11) NOT NULL PRIMARY KEY,
title varchar(200) NOT NULL,
#--the description for this problem
description text,
#--the problem source where the problem is referrenced.
source varchar(100),
#--the create date when the problem is created.
input_description text,
output_description text,
input_sample text,
output_sample text,
hint varchar(255), create_date timestamp default CURRENT_TIMESTAMP, #--the test input data file location,this is a directory
input_path varchar(1024),
#--the test output data file location,this is a directory
output_path varchar(1024),
base_time_limit int(11) NOT NULL default 0,
base_memory_limit int(11) NOT NULL default 0,
case_time_limit int(11) NOT NULL default 0,
case_memory_limit int(11) NOT NULL default 0, #--valid flag the status of this problem
valid tinyint(4) NOT NULL default 1,
#--by default problem belongs to no contest
contest_id int(11) default 0, accepted int(11) default 0,
submit int(11) default 0
)
在mysql命令行下使用source a.sql会出现错误:
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 J
udgeOnline
create table if not exists Problem
(
problem_id int(11) NOT NU' at line 2
==============================================================
我将create table那段单独拿出来执行没有问题,为什么整个sql脚本执行会出错啊?
#--create database if not exists an older one
create database if not exists JudgeOnlineuse JudgeOnline#--create problem table contain all the problem information
create table if not exists Problem
(
problem_id int(11) NOT NULL PRIMARY KEY,
title varchar(200) NOT NULL,
#--the description for this problem
description text,
#--the problem source where the problem is referrenced.
source varchar(100),
#--the create date when the problem is created.
input_description text,
output_description text,
input_sample text,
output_sample text,
hint varchar(255), create_date timestamp default CURRENT_TIMESTAMP, #--the test input data file location,this is a directory
input_path varchar(1024),
#--the test output data file location,this is a directory
output_path varchar(1024),
base_time_limit int(11) NOT NULL default 0,
base_memory_limit int(11) NOT NULL default 0,
case_time_limit int(11) NOT NULL default 0,
case_memory_limit int(11) NOT NULL default 0, #--valid flag the status of this problem
valid tinyint(4) NOT NULL default 1,
#--by default problem belongs to no contest
contest_id int(11) default 0, accepted int(11) default 0,
submit int(11) default 0
)
在mysql命令行下使用source a.sql会出现错误:
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 J
udgeOnline
create table if not exists Problem
(
problem_id int(11) NOT NU' at line 2
==============================================================
我将create table那段单独拿出来执行没有问题,为什么整个sql脚本执行会出错啊?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货