How to back up a database on another host from a remote Linux host

Source: Internet
Author: User
Tags mysql version web services
1. Description of the problem

In general, there is a limit to the login IP of the database.
For Web services and MySQL services on the same machine, the general limit is that only the local computer can access the MySQL service.
For web and MySQL service separation, it is generally specified that only the host of the Web service can access the MySQL service. 2. Backup

Suppose 192.168.0.1 is running a Web service, 192.168.0.2 is a MySQL service. Only 192.168.0.1 can access MySQL on 192.168.0.2, and MySQL's account is root, password is 12345, Port 3306, database name test.
Also, suppose there is no write permission on the 192.168.0.1, which means that the data we mysqldump out cannot be saved as a local file.

Tools Required: Xshell First make sure that MySQL is installed on the 192.168.0.1 with the same version as 192.168.0.2. If the MySQL version of 192.168.0.1 on the hell 192.168.0.2, it may fail. Xshell login 192.168.0.1, and Xshell turn on logging: file-> log-> boot. and select the address where the backup file is stored.
Xshell use the following command to back up the table. The obtained log file is the mysqldump result.

Mysqldump-h192.168.0.2-uroot-p12345-p 3006 Test
3. Restore to upload the resulting database files on the machine to be restored. Run the following command:

Login

Mysql-uroot-p

Under the mysql> command line

Create a new table

Create DATABASE Test

Restores

Source/home/root/backup.sql

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.