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