In database management, files are commonly used to read data (import) from text files: CSV (Comma Separated Values) files. The Comma-Separated Values are as follows: www.2cto.com [plain] M0001, Li Gang, 1976-01-05,1 M0002, Wang Er, 1955-01-15,1 M0003, Li Si, 1967-03-05,1 [SQL] LOAD DATA INFILE 'd: /myCodes/test. cvs 'into TABLE member fields terminated by ','; -- Note test. SELECT * into outfile 'd:/myCodes/out. cvs 'fields terminated by ',' FROM member; execute the SQL command stored in the file [SQL] SOURCE D:/myCodes/ Test. SQL -- SOURCE is not an SQL command, so there is no plus points at the end; mysql test-uroot-p-e "SOURCE D:/myCodes/test. SQL "-- test is the database name. You can write the preceding SQL statements into batch processing files, for example, [plain] mysql test-uroot-p-e" SOURCE D:/myCodes/test. SQL "pause saves the SQL Execution results to input devices such as the keyboard and mouse in the file, known as standard input, display, and other devices, and is a standard output. Standard input and standard output devices can be changed. Such changes are called redirection ). In the command window, [SQL] dir> D:/myCodes/redirect.txt dir> D: \ myCodes \ redirect.txt TYPE D: \ myCodes \ redirect.txt HELP TYPE MySQL, [SQL] mysql-uroot-p> D: \ myCodes \ log.txt TYPE D: \ myCodes \ log.txt mysql-uroot-p-e "SOURCE D:/myCodes/test. SQL "> D: \ myCodes \ log.txt USE the tee command to save the execution result of the SQL statement to the file [SQL] tee D:/myCodes/teeLog.txt USE home; SELECT * FROM customer; notee; EXIT; type d: \ myCodes \ teeLog.txt database backup and recovery operation to save the entire database to a file, called dump to restore the dump text file to the database, called Recovery (restore) [SQL] mysqldump-u root-p home> D: /myCodes/home_back. SQL -- default-character-set = utf8 mysqladmin-u root-p CREATE home1 mysql-u root-p home1 <D: /myCodes/home_back. SQL -- default-character-set = utf8