Teach you foreign host fast backup database and restore

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

Recently bought BH host space, one months to use a pretty handy, but has been stranded in the unknown how to efficiently backup the database and restore operations, and inadvertently see BH support SSH, contact customer service, upload ID card opened SSH (how to open the text in this article). Next, let's explain how the Bluehost host backs up and restores the database via SSH.

Back up the database:

1, the use of Putty login ssh, enter the host user name and password

2, display login success information, said already logged in

3, use the command "CD public_html" into the public_html directory, because we want to put the database backup files under this directory (you need to put the database backup files under which directory, you must first enter this directory)

4, Input BACKUP DATABASE command: Mysqldump-u database username-p Database password database name > database backup filename. SQL (do not use Chinese)

Hit Enter, wait a moment, if there is no error prompted that the database has been backed up successfully.

Restore Database

Preparation: Before restoring the database, first create database, database user, bind database user to database

1, enter the directory where you store the database files, enter the command: Mysql-u database username-p Database Password database name < database backup file. sql

2, knock return, wait a moment, if there is no hint of information, congratulations, the database has been imported successfully

This article by http://www.xiaocaocn.com Original, reprint please specify

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.