Mysql-u User name-p password
Mysql> Use Database
Mysql> SELECT columnid,alias,parentid from ' Cms_column ' WHERE alias like '% home theater% ' OR parentid= ' 144500 ' into outfile '/V Ar/lib/mysql-files/column_rb.xls ';
If the following interface appears:
If there is an error in the red box, it means that your MySQL profile import and export permission is limited, only through the Secure_file_priv path to operate, here my path is/var/lib/mysql-files/
Either modify the MySQL configuration file, release the permissions, or change the path.
No special rules directory path, here I am not so troublesome, directly copy the file to the/var/lib/mysql-files/path to execute the above command to export, as follows:
Mysql> SELECT columnid,alias,parentid from ' Cms_column ' WHERE alias like '% home theater% ' OR parentid= ' 144500 ' into outfile '/V Ar/lib/mysql-files/column_rb.xls ';
You will then see:
This will be a success.
The following describes the local or log on to the server, the. cvs file is imported into the MySQL database corresponding to the table, here I am on the company server operation, prepare the data as follows:
--Anshun (the following 7 lines are a total of one SQL statement)
LOAD DATA INFILE '/VAR/LIB/MYSQL-FILES/BOSS/ORDERINFO-ANSHUN.TSV '--the file to be imported
into TABLE orderinfo field TERMINATED by ' \ t '---according to the TAB \ t can also be a comma, each of the fields are split
Optionally enclosed by ' "' lines terminated by ' \ r \ n '--according to \ r \ n It is a piece of data to be wrapped.
Ignore 1 lines--excluding the first line
(UserID, Permark, Keyno,subkind,pcode,serialno,payway,opcode,ordertime,yxcode,servid,fees,payfees,status, Isgrppay,discount,patch,company,area); --The fields in parentheses are the tables to import
--Liupanshui
LOAD DATA INFILE '/VAR/LIB/MYSQL-FILES/BOSS/ORDERINFO-LIUPANSHUI.TSV '
Into TABLE orderinfo fields TERMINATED by ' \ t '
Optionally enclosed by ' "' lines terminated by ' \ r \ n '
Ignore 1 lines
(UserID, Permark, Keyno,subkind,pcode,serialno,payway,opcode,ordertime,yxcode,servid,fees,payfees,status, Isgrppay,discount,patch,company,area);
--Tongren
LOAD DATA INFILE '/VAR/LIB/MYSQL-FILES/BOSS/ORDERINFO-TONGREN.TSV '
Into TABLE orderinfo fields TERMINATED by ' \ t '
Optionally enclosed by ' "' lines terminated by ' \ r \ n '
Ignore 1 lines
(UserID, Permark, Keyno,subkind,pcode,serialno,payway,opcode,ordertime,yxcode,servid,fees,payfees,status, Isgrppay,discount,patch,company,area);
--Zunyi
LOAD DATA INFILE '/VAR/LIB/MYSQL-FILES/BOSS/ORDERINFO-ZUNYI.TSV '
Into TABLE orderinfo fields TERMINATED by ' \ t '
Optionally enclosed by ' "' lines terminated by ' \ r \ n '
Ignore 1 lines
(UserID, Permark, Keyno,subkind,pcode,serialno,payway,opcode,ordertime,yxcode,servid,fees,payfees,status, Isgrppay,discount,patch,company,area);
--Guiyang
LOAD DATA INFILE '/VAR/LIB/MYSQL-FILES/BOSS/ORDERINFO-GUIYANG.TSV '
Into TABLE orderinfo fields TERMINATED by ' \ t '
Optionally enclosed by ' "' lines terminated by ' \ r \ n '
Ignore 1 lines
(UserID, Permark, Keyno,subkind,pcode,serialno,payway,opcode,ordertime,yxcode,servid,fees,payfees,status, Isgrppay,discount,patch,company,area);
MySQL query results data are exported into the database into fileout and cvs/txt related files