数据库端导出:
[root@linuxme ~]# mysql -uroot -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 53792 Server version: 10.1.16-MariaDB-enterprise MariaDB Enterprise Certified Binary Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> use adamhuan; Database changed MariaDB [adamhuan]> select * from people; +----+------------+------+----------+---------+ | id | name | age | location | other | +----+------------+------+----------+---------+ | 1 | tim_tian | 34 | shanghai | Monitor | | 2 | eric_huang | 89 | shanghai | PM | | 3 | Neo_Guo | 73 | shanghai | CUST | | 4 | Henry_Cai | 24 | shanghai | coding | +----+------------+------+----------+---------+ 4 rows in set (0.00 sec) MariaDB [adamhuan]> MariaDB [adamhuan]> select * from people into outfile '/tmp/mysql_output_adamhuan_people.xls'; Query OK, 4 rows affected (0.03 sec) MariaDB [adamhuan]> exit Bye [root@linuxme ~]# ls -ltr --time-style="+|%Y-%m-%d|%H:%M:%S|" /tmp | grep --color mysql_output -rw-rw-rw- 1 mysql mysql 117 |2016-09-21|14:24:20| mysql_output_adamhuan_people.xls [root@linuxme ~]#
然后,把导出文件拉到本地,并打开:
这样,就结束了。
————————————————————————
2016年9月21日14:29:49