MySQL data import and export methods and tools (2) batch processing import files, import data from SQL files to the database, batch processing is a non-interactive method to run mysql programs, like the commands you use in mysql, you will still use these commands.
To implement batch processing, you need to redirect a file to the mysql program. First, we need a text file containing the same text as the command we entered in mysql.
The suffix and any other legal names do not have to end with SQL ):
USE Meet_A_Geek;
Insert into mers (Customer_ID, Last_Name) VALUES (NULL, "Block ");
Insert into mers (Customer_ID, Last_Name) VALUES (NULL, "Newton ");
Insert into mers (Customer_ID, Last_Name) VALUES (NULL, "Simmons ");
Note that the syntax of these sentences must be correct, and each sentence ends with a semicolon. Select the database for the above USE command, and INSERT the command to INSERT data.
Next, we need to import the above files to the database. before importing the files, we need to confirm that the database is running, that is, the mysqld process (or service, which is called "service" under Windows NT). unix is running.
Then run the following command:
Bin/mysql