mysql数据库表如何导出到excel

来自:互联网
时间:2020-09-09
阅读:

MySQL数据库表导出到excel的方法:

方法一

用mysql的命令和shell

select * into outfile './bestlovesky.xls' from bestlovesky where 1 order by id desc limit 0, 50;

方法二

把bestlovesky.xls以文本方式打开,然后另存为,在编码选择ansi编码,保存

echo "select id,name from bestlovesky where 1 order by id desc limit 0, 50;"| /usr/local/mysql/bin/mysql -h127.0.0.1-uroot -p123456 > /data/bestlovesky.xls

方法三

使用mysql命令

mysql -uroot -p -e "select * from test.table2 " > d:a.xsl
返回顶部
顶部