1. MySQL export local database data to local file mysql-Aservice_db-hyour_host-utest-ptestmysqlgt; select * fromt_1_wherecr
1. MySQL exports local database data to the local file mysql-A service_db-h your_host-utest-ptestmysqlgt; select * from t_apps where cr
1. MySQL exports local database data to a local file
Mysql-A service_db-h your_host-utest-ptest
Mysql> select * from t_apps where created> '2017-07-02 00:00:00 'into outfile/tmp/example .csv
2. MySQL exports remote database data to a local file
Mysql-A service_db-h your_host-utest-ptest-ss-e "SELECT * from t_apps limit 300;" | sed's/\ t/","/g; s/^/"/; s/$/"/; s/\ n // G'> pai.csv
(Sed can be omitted, especially when processing data containing Chinese characters)
3. Use mysqldump to export remote or local data to a local file
Mysqldump-h your_host-utest-ptest-w "id <300" service_db t_apps> tt. SQL
If only-t or -- no-create-info is added to the imported data;
If you add-d or -- no-data;
4. mysqldump cannot specify the exported column. The work und is as follows:
Mysql-u USERNAME -- password = PASSWORD -- database = DATABASE -- execute = 'select 'field', 'field' FROM 'table' LIMIT 0, 100'-X> file.csv
,