mysql In Batch Mode
- To run
mysql in batch mode put the commands in a file, then tell mysql to read its input from the file.
- Reasons for running
mysql in batch mode are:
- Making a script avoids retyping the same commands over and over.
- Generate new queries that are similar to existing ones by copying and editing script files.
- The script can be distributed to other people so that they can also run the commands.
- If a query produces a lot of output, run the output through a pager or send it to a file rather than watching it scroll off the top of the screen:
mysql < batch-file | more
mysql < batch-file > output-file
How do I go about using MySQL with Apache?
© 2007 John Michael Pierobon
Notes