Summary of MySQL database import and Export method

Source: Internet
Author: User

General form: mysqldump-h ip-u user name-p database name > exported file name

(1)-P can not add password, can only be entered as 1 in the same way (2) mysqldump is under the cmd command, no longer MySQL under, that is, can not enter the MySQL (that is, use dpname under, you have to exit MySQL under the exit can be.) )

One: Export of database (backup)

0: (Backing up the database is exporting all the tables and the data does not add-D)

Mysqldump-h localhost-u root-p Test > G:\arcgisworkspace\zypdoc\test.sql

Mysqldump-h 10.180.6.183-u root-p dmsdev > D:\imssdb\20170930\dmsdev20170930.sql
Mysqldump-h 10.180.6.183-u root-p newfwk > D:\imssdb\20170930\newfwk20170930.sql
Mysqldump-h 10.180.6.183-u root-p dcsdev > D:\imssdb\20170930\dcsdev20170930.sql

II: Database import (Restore)

0: Import the database (first to create data, then import) C:\Program files\mysql\mysql Server 5.5\bin>

Mysql-h localhost-u root-p (enter MySQL below)

CREATE DATABASE ABC;

show databases; (You can see all the databases that already exist, and the database ABC you just created)

Use ABC; (enter the ABC database below)

Show tables; (see all the tables below the ABC database, empty)

SOURCE G:\arcgisworkspace\zypdoc\test.sql (Import database table)

Show tables (see all tables below the ABC database to see the table)

desc pollution; (view table structure design)

SELECT * from pollution;

Exit (or CTRL + C) quit MySQL

Summary of MySQL database import and Export method

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.