MySQL使用脚本批量创建数据库并导入数据
CREATE TABLE IF NOT EXISTS Subscribers (
SubscriberId int NOT NULL primary key,
RatePlan varchar(6) NOT NULL,
MonthlyFee float NOT NULL,
Market varchar(10) NOT NULL,
Channel varchar(6) NOT NULL,
StartDate date default NULL,
StopDate date default NULL,
StopType char(1),
Tenure int default NULL,
IsActive int default NULL
);
LOAD DATA INFILE "C:\Users\ZHUGANGGGANG\Desktop\WileyCompanion\data\Subscribers.txt" IGNORE INTO TABLE Subscribers IGNORE 1 ROWS;
保存在XXX.sql文件中,在mysql命令行中使用source XXX.sql执行。