MySQL Export and import data Mysqldump,source

Source: Internet
Author: User

Export Database (mysqldump):

Export database: Mysqldump-u user name-p database name > exported file name

mysqldump-uroot-pgameol32! Lottery >/home/lottery.sql (Enter the password to start exporting the database)

(If you export a single table, enter the table name after the database name)


Synchronize the exported database. sql file to the server on which you want to import (rsync):

Rsync-av/home/lottery.sql 10.10.86.100:/home/

The target server needs to turn on the firewall, put the IP, Port 22, protocol TCP

The target server needs to turn on sshd, allowing the root user, password login (for servers that only allow key logins)


Import Database (source):

mysql-uroot-pgameol32!

MySQL use lottery; Select a database,

If you are synchronizing on the basis of a previous original library,

Two methods: 1. Incremental update. 2. Delete the original library lottery drop, and then lottery from the new library, or the data will be imported incorrectly

SOURCE/HOME/LOTTERY.SQL specifies the absolute path of the. sql file being imported.


Import Method 2:

cd/data/mariadb/

Mysql-uroot-p lottery

MySQL Export and import data Mysqldump,source

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.