How do you run SQL script from a Unix Shell?

Answer

The basic format is mysql (any mysql options) < sql_script_you_want_to_run.sql for mysql, and psql (any psql options) < sql_script_you_want_to_run.sql for postgresql.

Improve Answer Discuss the question "How do you run SQL script from a Unix Shell?" Watch Question

First answer by ID203601809. Last edit by ID203601809. Question popularity: 17 [recommend question]


Research your answer:

Answers.com > Wiki Answers > Categories > Technology > Computers > Computer Programming > How do you run SQL script from a Unix Shell?

Our contributors said this page should be displayed for the questions below. (Where do these come from)
If any of these are not a genuine rephrasing of the question, please help out and edit these alternates.
What is shell script?  Shell Scripting in UNIX?  What is job run in UNIX system?  Where can you find sql script examples?