MySQL supports batch processing to execute a batch of SQL statements. The following example shows how MySQL executes SQL statements in windows batch processing.
MySQL supports batch processing to execute a batch of SQL statements. The following example shows how MySQL executes SQL statements in windows batch processing.
MySQL supports batch processing to execute a batch of SQL statements. The following example shows how MySQL executes SQL statements in windows batch processing.
Create table test (id int, name varchar (20 ));
Insert into test values (1, 'watson ');
Batchfile.txt contains the following SQL statements, which are stored in c:/batchmysql/batchfile.txt of windows.
Insert into test select * from test;
Insert into test select * from test;
Insert into test select * from test;
Insert into test select * from test;
Insert into test select * from test;
Insert into test select * from test;
Insert into test select * from test;
Insert into test select * from test;
Insert into test select * from test;
Insert into test select * from test;
Insert into test select * from test;
Insert into test select * from test;
Insert into test select * from test;
Insert into test select * from test;
Insert into test select * from test;
In the cddl database, run the following statements in batches:
Mysql-uroot-p-D cddl <c:/batchmysql/batchfile.txt
Below is the query information contained in the batch processing, and the output is saved to a file:
The corresponding batchfile2.txt contains query information (the following three SQL statements). The following mysql0716.out records the select * from test limit 200; query statement result set.
Select * from test limit 200;
Insert into test select * from test;
Insert into test select * from test;
You can catch the output in a file for further processing:
Mysql-uroot-p-D cddl <c:/batchmysql/batchfile2.txt> c:/batchmysql/mysql0716.out
-------------------------------------- Split line --------------------------------------
Install MySQL in Ubuntu 14.04
MySQL authoritative guide (original book version 2nd) Clear Chinese scan PDF
Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL
Build a MySQL Master/Slave server in Ubuntu 14.04
Build a highly available distributed MySQL cluster using Ubuntu 12.04 LTS
Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu 12.04
-------------------------------------- Split line --------------------------------------