MySQL backup database and restore database operations

Source: Internet
Author: User
Tags mysql backup mysql backup database

To back up the database:

Server 1:192.168.26.210

Mysqldump-uroot-p-h127.0.0.1--all-databases--flush-logs--master-data=2--lock-all-tables >all.sql

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/8C/2C/wKiom1hkYDPgTknWAADJWbh9uT8153.png-wh_500x0-wm_3 -wmp_4-s_483847755.png "title=" 1.png "alt=" Wkiom1hkydpgtknwaadjwbh9ut8153.png-wh_50 "/>

Copy the data to a different server (192.168.26.212):

Execute command on server 1 (192.168.26.210): SCP all.sql node3:/data/

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/8C/29/wKioL1hkYFixfjdeAAD0Y0--AaA719.png-wh_500x0-wm_3 -wmp_4-s_1953992294.png "title=" 2.png "alt=" Wkiol1hkyfixfjdeaad0y0--aaa719.png-wh_50 "/>

View the backup data and import data on server 2 (192.168.26.212):

Execute command: LS

Mysql-uroot-p-h127.1<all.sql

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/8C/29/wKioL1hkYHrR2Q-fAAB1pSJ8iJI952.png-wh_500x0-wm_3 -wmp_4-s_1504676549.png "title=" 3.png "alt=" Wkiol1hkyhrr2q-faab1psj8iji952.png-wh_50 "/>

To see if the import data was successful:

Execution command: show databases;

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/8C/2C/wKiom1hkYLqRJML_AAC6jzkKsIo929.png-wh_500x0-wm_3 -wmp_4-s_3433646293.png "title=" 4.png "alt=" Wkiom1hkylqrjml_aac6jzkksio929.png-wh_50 "/>

This article comes from "on the road ... Find the Lost Memory "blog, be sure to keep this source http://jdonghong.blog.51cto.com/3473478/1887144

MySQL backup database and restore database operations

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.