movielens数据集.dat文件导入msql

使用mysql的图形化客户端,我用的是“MySQL-Front”,进入sql编辑器,输入下面的sql语句并运行即可:


LOAD DATA LOCAL INFILE 'C:\\Users\\luoyebei\\Desktop\\ml-1m\\movies.dat' 
INTO TABLE movies_info
FIELDS TERMINATED BY '::' 
(film_id,film_name,type);


LOAD DATA LOCAL INFILE 'C:\\Users\\luoyebei\\Desktop\\ml-1m\\ratings.dat' 
INTO TABLE ratings_info
FIELDS TERMINATED BY '::' 
(user_id,film_id,rating,timestamp);


LOAD DATA LOCAL INFILE 'C:\\Users\\luoyebei\\Desktop\\ml-1m\\users.dat' 
INTO TABLE users_info
FIELDS TERMINATED BY '::' 
(user_id,gender,age,occupation,zipcode);


展开阅读全文

没有更多推荐了,返回首页