0

Server : MySQL Query : SQL Requirement : Shell Script

How do I run a sql query using shell script for mysql server. This will help me in automating the task.

Hansal
  • 11
  • Possible duplicate of [How to execute a MySQL command from a shell script?](http://stackoverflow.com/questions/8055694/how-to-execute-a-mysql-command-from-a-shell-script) – dparoli Mar 29 '17 at 20:13
  • I have to output of this query in an Excel File. What more do I add to this query? – Hansal Mar 29 '17 at 21:29

1 Answers1

0
mysql -u USER -p PASSWORD -h MYSQLSERVERNAME -e 'select * from foo...' database-name
Teja
  • 13,214
  • 36
  • 93
  • 155