monetdb导入

1.从mysql中导出文件

 select * into outfile '/tmp/http_movie.txt'  FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '"'  LINES TERMINATED BY '\n' from http_movie;

2.从mysql中提取建表sql

show create table http_movie;

 

3.对sql进行修改,如下:

CREATE TABLE http_movie ( id int, movieid int, moviename varchar(255), director varchar(255), actor varchar(255),  area varchar(255),  movietype varchar(255),  timespan varchar(255),  base varchar(255),  publishdate varchar(255) ,  description text,  poster varchar(255),  serials varchar(255),  compere varchar(255),  playcount int,  label varchar(255),  playstation varchar(255),  created date ,  commetcount int,  collectcount int,  score float,  awardrecord text,  status int,  editor int);

 

发现支持int float date varchar text等类型,但除了varchar之外,都不要传大小。

主键也和php不一样。

如果发现建错了,可以通过 drop table http_movie;
进行删除,重新创建

 

查看http_movie表的列

select * from sys.storage() where "table" = 'http_movie';


 

4.导入数据

 

/usr/local/bin/mclient -d voc -u voc -s "COPY INTO http_movie FROM stdin USING DELIMITERS '\\t','\\n','\"'" - </tmp/http_movie.txt

 

 

 

 

你可能感兴趣的:(net)