GNU Info

Info Node: (mysql.info)Batch Commands

(mysql.info)Batch Commands


Prev: perror Up: Client-Side Scripts
Enter node , (file) or (file)node

How to Run SQL Commands from a Text File
----------------------------------------

The `mysql' client typically is used interactively, like this:

     shell> mysql database

However, it's also possible to put your SQL commands in a file and tell
`mysql' to read its input from that file.  To do so, create a text file
`text_file' that contains the commands you wish to execute.  Then
invoke `mysql' as shown below:

     shell> mysql database < text_file

You can also start your text file with a `USE db_name' statement.  In
this case, it is unnecessary to specify the database name on the command
line:

     shell> mysql < text_file

Note: Client-Side Scripts.


automatically generated by info2www version 1.2.2.9