Mysql local data import from remote database _ MySQL

Source: Internet
Author: User
Mysql locally imports data from a remote database bitsCN.com


Mysql locally exports data from a remote database

Preface: I recently started to use the Ubuntu system. there is really no good mysql interface program, so I can only operate it on a terminal.

Procedure: open Terminal, enter the following content, and press enter.

That's all!

Purpose: Copy the database of the remote server to a local device.

Java code

Mysqldump-h '2017. 212.111.123 '-uROSE-pxxxooo -- opt -- compress ITSM -- skip-lock-tables | mysql-h localhost-uroot-proot ITSMC

* ********************* Gejige 1: if you do not know the truth, see the following *******************************

Explanation:

114.212.111.123 remote server name

ROSE remote database login name

Xxxooo remote database logon password

ITSM remote database name (that is, the source of the copy)

Localhost local database name (usually this is the name)

Root local database login name (this is usually the case)

Root local database logon password (this is usually the case)

ITSMC local (that is, the purpose of replication)

SQL explanation:

Mysqldump is a mysql command used for copy operations.

-- Meaning of opt operation

-- Compress: compresses the data to be transmitted

-- Skip-lock: ignore the locked table (this clause can prevent an error when the table has a foreign key)

-Tables: all tables in a database

-H server name

-U user name (* without spaces, add the user name directly)

-P password (* The password is directly added without spaces)

Note:

-U and-p are not followed by spaces. directly add the user name and password !!!

: None of your business ************************

This morning, the music of a song [not seeing you for a long time ]......

BitsCN.com

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.