MySQL direct export Excel spreadsheet
Executed in the shell command line
syntax:
echo query Login mysql pipeline link mode> directional output file
echo "SELECT * FROM table WHERE trail_time BETWEEN '1451577600' and ' 1483113600'" | mysql -h127.0.0.1 -u database account name -p database name> /home/2016.xls (storage path / filename)
After downloading the lead out to a local found Chinese garbled. Solution as follows:
use the server side to iconv transcoding
iconv -futf8 -tgb2312 -o original file name new file name
iconv -futf8 -tgb2312 -o2016-1.xls 2016.xls