Linux VPS Host MySQL database backup 4 methods

Source: Internet
Author: User
Tags vps phpmyadmin

From the virtual host over to the VPS, the general webmaster may feel the operation of the time cost is relatively large, although sometimes cheap vps compared to the virtual host a little cheaper, but the VPS in the operation of the dimension is more than the virtual host worry about some. For example, in the VPS maintenance, backup data, in the absence of the use of regular automatic backup function, but with manual backup, the backup cycle should be much shorter than the virtual host. For the Web page files, we can compress the FTP download way to do, MySQL database backup needs to be extra careful, once the backup error is missing, and then really need to restore the time can cause a lot of damage.

Below the old left collation most users compare the common Linux VPS Host Web site environment MySQL database backup mode:

First, phpMyAdmin Export method

Whether we use the Web panel, or the use of a key package, there should be installation phpMyAdmin, we can log in directly after the separate site for the database export. Before going anywhere, in order to minimize the unnecessary capacity of the database, we can clean up, optimize the database files, and then export the database.

Second, mysqldump command export

  code is as follows
standard command: Mysqldump-u database user name-P According to the library password--default-character-set= encoded database name > database file name. SQL
Demonstration case: mysqldump-ulaozuo-plaozuo.org --default-character-set=gb2312 Laozuo > Laozuo.sql
Here are two questions to note, the first is a Code problem. According to the code of your website database, is gb2312 or utf-8

Login vps with SSH, then export the database to root directory with mysqldump command, then download to local backup via FTP.

Third, download the original MySQL database file

Downloading database files directly may not be common, but is a good way to basically restore the database will not be lost. According to the Panel or script path we use, such as the AMH panel in the/usr/local/mysql/data/corresponding database name, the WDCP panel database original file in/www/wdlinux/mysql/var corresponding database name folder. Download to local, and then if you need to restore the corresponding database name upload replacement can be.

Four, use the imperial backup King backup software

Empire Backup King Software is a good MySQL database backup software, we can download through the official, and then put to the site root directory, after the login to set up binding database link files, backup data after the backup of the king to download to the local. If you need to restore the database, bind the new database directly, and then choose to restore the database directory to resolve it.

If a larger site, or a more important site, we can use multiple methods of backup, preferably after testing data recovery is no problem, and then delete the old data, because in the event of failure to recover, or more terrible things.
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.