1、MySQL Derived data
(1)、 Use select ... into outfile Statement to export data
MySQL You can use SELECT...INTO OUTFILE Statement to simply export data to a text file . And you can set the specified format of data output through command options .
# grammar SELECT * FROM Table name INTO OUTFILE ' text file ';# Example SELECT * FROM test INTO OUTFILE '/back/test.txt';
(2)、 Export table as raw data
mysqldump yes mysql Utility for transferring storage databases . It mainly produces a SQL Script , It contains the commands necessary to recreate the database from scratch CREATE TABLE INSERT etc. .
Use mysqldump Export data needs to use --tab Option to specify the directory specified by the export file , The goal must be writable .
# Put the data sheet test Export to /tes Directory :mysqldump -u root -p123456 --no-create-info --tab=/tes RUNOOB test
(3)、 export SQL Formatted data
# grammar :# mysqldump -h The server -u user name -p password Database name > Backup file .sql# Example :# Single database backup mysqldump -uroot -p123456 db1 > db1.sqlmysqldump -uroot -p123456 db1 table1 table2 > db1-table1-table2.sql# Multi database backup mysqldump -uroot -p123456 --databases db1 db2 mysql db3 > db1.........