Mysql database backup import export data import export database and data table Import and Export we use mysqldump to operate, data import and export we use load data infile and load data outfile operations
Mysql tutorial database tutorial backup import export data import data export
We use mysqldump to import and export databases and data tables,
We use the load data infile and load data outfile operations to import and export data.
Export Database Method
Parameter: mysqldump-u username-p Password Database> Save file address
Mysqldump-uroot-proot company> d: first. SQL
Method 1
Mysqldump-uroot-proot company> d: ft. SQL useramdin
Export data
Note:-u user name-p password company Database Name> d: first. SQL import data and save it as the file table name
Another method for exporting data tables
Usage: mysqldump-u user name-p database name Table Name> exported file name
Import data:
Mysql> source d:/firest. SQL // The data you just exported
Single Table Import
Mysql> source d:/fit. SQL
Import and export data
Import data using load data infile "file table data" table Name
The content of the instance in the D: test.txt file should be noted: the space should be separated by the tab key or null should be represented by n
2 admin2 e10adc3949ba59abbe56e057f20f883e 0 2009-12-19 11:44:59 1
Mysql> load data infile "d: test.txt" table useradmin;
In this way, the data is inserted into the useradmin table.
Data Export
Mysql> use company;
Mysql> select * from useradmin into outfile "d: outfile.txt ";
Then you can view d: There will be an outfile.txt file.
Original Site reprint notes: www.111cn.cn. net tutorial "> www. bKjia. c0m