buhong 发表于 2017-12-13 08:42:26

【Mysql+shell】查询结果导出到文件,文件数据导入到数据库

mysql> use testDb2;  Reading table information for completion of table and column names
  You can turn off this feature to get a quicker startup with -A
  Database changed
  mysql> select * from natTable;
  +--------------+------+-----------+----------+---------------------+------------+----------+------------+----------+------------+----------+----------+---------------+-----------+--------------+----------+---------+
  | receive_time | host | host_vsys | severity | log_time            | src_ip   | src_port | nat_ip   | nat_port | dst_ip   | dst_port | protocol | server_name   | user_name | mac          | category | rule_id |
  +--------------+------+-----------+----------+---------------------+------------+----------+------------+----------+------------+----------+----------+---------------+-----------+--------------+----------+---------+
  | 06:00:03   |    8 | NULL      |      6 | 2017-03-03 05:42:47 | 1232283696 |    51828 | 1234315965 |    35429 | 1233279515 |    53934 |       49 | NULL          | NULL      | NULL         |      1 |      58 |
  | 06:00:57   |    8 | NULL      |      6 | 2017-03-03 05:43:41 | 1232307391 |    36441 | 1234315965 |    37272 | 1233238803 |    31747 |       35 | 10.180.45.100 | sjyang    | 111122223333 |      1 |      97 |
  | 06:03:54   |    8 | NULL      |      6 | 2017-03-03 05:46:38 | 1232279540 |    29735 | 1234315965 |    33755 | 1233252778 |    30256 |       14 | NULL          | NULL      | NULL         |      1 |       2 |
  +--------------+------+-----------+----------+---------------------+------------+----------+------------+----------+------------+----------+----------+---------------+-----------+--------------+----------+---------+
  3 rows in set (0.01 sec)
  mysql>
页: [1]
查看完整版本: 【Mysql+shell】查询结果导出到文件,文件数据导入到数据库