Mysql database backup import export data import data export

Source: Internet
Author: User
Tags mysql tutorial

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

 

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.