Mysql query results are saved to a file, the file downloaded from the network to the external network server

Method One: 
direct execute the command:

mysql> SELECT ordersid from yws.callback_clockd  ORDER BY ordersid ASC limit 0,1000000   into outfile '/var/lib/mysql-files/callback_clockd.xls';

Method Two: 
out of mysql command-line

 mysql -h 127.0.0.1 -u root -p XXXX -P 3306 -e "select * from table" > /tmp/test/txt

下载:scp  [email protected]:/var/lib/mysql-files/callback_clockd.xls   /

Guess you like

Origin www.cnblogs.com/flzs/p/11302518.html