Executing
In
If you are already running mysql, you can execute an SQL script file using the source command or \. command:
#mysql #execute #command #statement
MySQL
statements from a text file:In
MySQL
it is possible to put your SQL statements
in a file and then tell mysql to read its input from that file. To do so, create a text file text_file that contains the statements you wish to execute. Then invoke mysql as shown here:shell> mysql db_name < text_file
NOTE:
If you place a USE db_name
statement as the first statement in the file, it is unnecessary to specify the database name on the command line.If you are already running mysql, you can execute an SQL script file using the source command or \. command:
mysql> source file_name
#mysql #execute #command #statement