How to import and export MySQL databases?

Source: Internet
Author: User

This article mainly describes the actual operation process of MySQL Database Import and Export. We use instances to introduce the actual operation steps, if you are interested in the actual operations, you can browse the following articles. Hope you will have some gains.

1. Export the entire database

MySQLdump-u username-p Password Database Name> exported file name

 
 
  1. MySQLdump -u jason -p jason roomdatadb> roomdatadb.sql 

2. Export a table

MySQLdump-u user name-p Password Database Name Table Name> exported file name

 
 
  1. MySQLdump -u jason -p jason roomdatadb t_roomdata> t_roomdata.sql 

3. Export a database structure

 
 
  1. MySQLdump -u jason -p jason -d --add-drop-table roomdatadb> d:\roomdatadb.sql 

-D no data -- add-drop-table adds a drop table before each create statement.

4. Import the database

Common source commands

Go to the MySQL Database Console,

For example, MySQL-u root-p

MySQL> use Database

Then run the source command. The following parameter is the script file, as shown in. SQL)

 
 
  1. MySQL>source d:\wcnc_db.sql 

See MySQL Data Import tool: MySQLdump

The above content is an introduction to the import and export of MySQL databases. I hope you will have some gains.

The above content is the description of MySQL Database Import and Export, hoping to help you in this regard.

Original article title: MySQL Database Import and Export

Connection: http://www.cnblogs.com/jason-one/archive/2009/03/13/1410778.html

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.