MYSQL Backup Restore

Source: Internet
Author: User
Tags mysql backup pscp

MySQL Backup Restore method

MySQL backup and restore we typically do this by backing up the database on a live MySQL database (typically a Linux system) (typically dozens of g to hundreds of grams) to a Windows machine, Then go to the company and restore the files on the Windows machine to the MySQL database on your company's Linux system.

This document is primarily used for manipulation of large databases that require backups (there are many other easy ways to have a small database). In reality we usually do 1, 2 steps in the field, then 3, 4 steps are done in the company.

1. Scenario for this article: Back up the MySQL database pqss0215old on 192.168.1.207 (CentOS) to the native (Win7), then upload the backed-up file to 192.168.1.207 (CentOS), and restore the backed-up database to Pqss0215old2 .

2. Software Required: Pscp.exe (used to transfer files between Linux and Win7), SECURECRT (for remote connection of Linux systems, document final PSCP and CRT Compression pack addresses)

3. Specific operation steps:

3.1. First, a backup of the MySQL database:

3.1.1 SecureCRT remote connection on 192.168.1.207.mysqldump command for backup, username root, password 123456, backup database pqss02155old, backup to file Pqss0215old1.sql

mysqldump-uroot-p123456 Pqss0215old>/usr/pqss0215old1.sql

Switch to the folder you just backed up, and you can see the backed up file Pqss0215old1.sql.

3.1.2 Compress the database files that have just been backed up.: gzip compression takes a few minutes, until the # sign shows that compression is complete.

3.2. Next, pass the file you just compressed to the local

3.2.1 Pass the compressed file to the local e-drive via the software Pscp.exe: Root is the username for login 207, and the password for the root username is entered after password.

When you are done, switch to e-drive to see the files passed in.

3.3 Passing a compressed package to a Linux system

3.3.1 The file that was just passed over the e-disk to 192.168.1.207.

In order to be different from the original file can give the file just passed over to modify the name pqss0215old2.sql.gz

The PSCP passes the pqss0215old2.sql.gz to the/usr/of the 207 system.


Now look at the 192.168.1.207/usr/, you can see the file just passed over.


3.4 Restore a backed-up database to a new database Pqss0215old2

3.4.1 New Database Pqss0215old2

3.4.2 Unzip the database file you just passed.

3.4.2 Restore Pqss0215old2.sql to the database pqss0215old2



PSCP and SECURECRT are here: http://download.csdn.net/download/luozuolincool/7984279


MYSQL Backup Restore

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.