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
原文地址:http://blog.51cto.com/jingfeng/2154169
时间: 2024-11-08 20:58:56