mysql 非交互查询 存入execl

1、MySQL如何实现非交互式查询?

mysql -h 172.16.136.9 -P6515 -u user -ppasswd db_name -e ‘select * from game_flow_balance where activityID = "yWyY1oi2" and (status = "2" or status ="4");‘

注意:-e 非交互 单引号内为查询语句。

2、如何存入execl表内?
直接输入到xls结尾的文件内
mysql -h 172.16.136.9 -P6515 -u user -ppasswd db_name -e ‘select * from game_flow_balance where activityID = "yWyY1oi2" and (status = "2" or status ="4");‘ >> /tmp/neimeng3.xls

相关文章