When using MySQL databases, data is often lost due to operation errors. MySQL database backup can help us avoid data loss or other database problems caused by various reasons. When using MySQL databases, data is often lost due to operation errors. MySQL database backup can help us avoid data loss or other database problems caused by various reasons.
I. data backup shortcuts
Because this method has not been verified in the official documentation, we call it a test.
Objective: to back up a MySQL database in the hostA host and restore it to the hostB
Test environment:
Operating system:WinNT4.0, Mysql3.22.34, phpMyAdmin 2.1.0
Install MySQL database backup in hostA and create TestA database
MySQL database backup is installed on the hostB, and no TestA database exists.
Procedure:
Start phpMyAdmin to check the database list in HostA and HostB. no TestA database exists in HostB.
Find the installation directory of MySQL database backup in HostA, and find the Database Directory data
In my test environment, this directory isC: \ mysql \ data
Find the subdirectory of the corresponding database nameC: \ mysql \ data \ TestA
Paste and copy the file to the Data directory of HostB, which is the same as that of the backup Data directory of the HostB MySQL database.
REFRESH The phpMyAdmin of HostB and check the database list. we can see that TestA has appeared, and the query and modification operations are normal. the backup recovery is successful.
Test conclusion: MySQL databases can be stored in the form of files, backup, recovery as long as the corresponding file directory can be restored, no need to use other tools to back up.