将/etc/passwd 中需要的内容输出到 /tmp/passwd中

  awk -F ':' '{print $1, $3, $4, $6, $7}' /etc/passwd > /tmp/passwd
创建表 passwd create table passwd (name char(10),uid int,gid int,home char(30),bash char(20));
导入数据load data infile '/tmp/passwd' into table passwd fields terminated by " ";
 
若出现

出现ERROR 13 (HY000): Can't get stat of '/tmp/passwd' (Errcode: 13) 表示当前导入数据的文件所在的目录权限不够 该为777就可以了