MySQL database backup Import Export data import data export

Source: Internet
Author: User
Tags mysql tutorial save file table name

MySQL Tutorial database tutorial Backup Import Export data import data export

Import and export of databases and datasheets we use mysqldump to manipulate,
Import and export of data we use the load data infile with the load data outfile operation

Exporting database methods

Parameters: Mysqldump-u user name-p password Database > save file Address

Mysqldump-uroot-proot company >d:first.sql

To export a datasheet method

Mysqldump-uroot-proot company >d:ft.sql Useramdin
Export data
Description:-u user name-p password Company database name >d:first.sql Import data Save as File table name

Another way to export a datasheet

Usage: mysqldump-u user name-P database name Table name > exported file name


Import data:

Mysql> source D:/firest.sql//data just exported

Single-Table Import

Mysql> Source D:/fit.sql

Data Import Export

Import data infile "File table data" table name with load

Example we have in the D:test.txt file content for note: To separate space with TAB key or NULL to indicate n

2 admin2 e10adc3949ba59abbe56e057f20f883e 0 2009-12-19 11:44:59 1

mysql> load Data infile "d:test.txt" table useradmin;

The data is then inserted into the Useradmin table.


Data export
Mysql>use Company;
Mysql>select * from useradmin into outfile "D:outfile.txt";
When you look at D: There will be a outfile.txt file.

Original reprint of this site annotated: www.111cn.net. NET Tutorial ">www.111cn.net

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.