安装

image.png

配置

配置文件:/etc/my.cnf

修改字符集

  • show variables like ‘character%’;

image.png

将csv文件中的数据导入相应的表中

导入

  • load data infile ‘/usr/local/mysql/data/csv/test.csv’ into table test fields terminated by ‘,’ enclosed by ‘“‘ lines terminated by ‘\n’ ignore 1 rows;
  • user_action:21.75s,共7317882条数据
  • select count(*) from user_action;1.89s
  • select * from user_action where userid=250236;2.44s
  • select * from user_action where userid=8;2.39s

创建userid索引