Query OK, 0 rows affected (0.01 sec)
Query OK, 37 rows affected (0.02 sec)
Records: 37 Deleted: 0 Skipped: 0 Warnings: 0
+----------+------+-----+-----+--------+-----------------+---------------+
| username | pass | uid | gid | common | homedir | shell |
+----------+------+-----+-----+--------+-----------------+---------------+
| bin | x | 1 | 1 | bin | /bin | /sbin/nologin |
| daemon | x | 2 | 2 | daemon | /sbin | /sbin/nologin |
| adm | x | 3 | 4 | adm | /var/adm | /sbin/nologin |
| lp | x | 4 | 7 | lp | /var/spool/lpd | /sbin/nologin |
| mail | x | 8 | 12 | mail | /var/spool/mail | /sbin/nologin |
+----------+------+-----+-----+--------+-----------------+---------------+
5 rows in set (0.00 sec)
-> into outfile "zhaoyunpasswd" fields terminated by ":" lines terminated by
-> "\n";
Query OK, 5 rows affected (0.04 sec)
/var/lib/mysql/zhaoyun
[root@zhaoyun zhaoyun]# ls
db.opt passwd passwd.frm passwd.MYD passwd.MYI test.frm test.MYD test.MYI zhaoyunpasswd
[root@zhaoyun zhaoyun]# cat zhaoyunpasswd
bin:1:1
daemon:2:2
adm:3:4
lp:4:7
mail:8:12
+----------+------+-----+-----+--------+---------+---------------+
| username | pass | uid | gid | common | homedir | shell |
+----------+------+-----+-----+--------+---------+---------------+
| root | x | 0 | 0 | root | /root | /bin/bash |
| bin | x | 1 | 1 | bin | /bin | /sbin/nologin |
+----------+------+-----+-----+--------+---------+---------------+
2 rows in set (0.00 sec)
+----------+------+-----+-----+--------+----------------+---------------+
| username | pass | uid | gid | common | homedir | shell |
+----------+------+-----+-----+--------+----------------+---------------+
| daemon | x | 2 | 2 | daemon | /sbin | /sbin/nologin |
| adm | x | 3 | 4 | adm | /var/adm | /sbin/nologin |
| lp | x | 4 | 7 | lp | /var/spool/lpd | /sbin/nologin |
+----------+------+-----+-----+--------+----------------+---------------+
3 rows in set (0.00 sec)
load data infile '文件名' into table 表名 fields terminated by "分隔符" lines terminated by "换行符";