SoFunction
Updated on 2025-03-09

The easiest MySql database backup method MySQLdump page 1/2

Using MYSQL for database backup has a very formal database backup method, which has the same concept as other database servers. But have you ever thought that MySQL will have a simpler backup method using file directories, and it is faster and better.
1. Data backup shortcut

Because this method has not been verified by official documents, we temporarily call it the experiment.
Purpose: Back up a MySQL database TestA in the hostA host and restore it to the hostB machine.

Test environment:

Operating system: WinNT4.0, MySQL3.22.34, PHPMyAdmin 2.1.0 Chinaz

Install MySQL database in hostA and create a TestA database
The MySQL database is installed on the hostB machine, but there is no TestA database.

Methods and steps:

Start PHPMyAdmin to view the database list in HostA and HostB. There is no TestA database in HostB.


Find the installation directory of MySQL in HostA and find the database directory data


In my experimental environment, this directory is

C:\MySQL\data 


Find the subdirectory of the corresponding database name

C:\MySQL\data\TestA 

Paste and copy it to the Data directory of HostB. It is the same file in HostA and HostB MySQL data directory.

Refresh PHPMyAdmin of HostB and check the database list. We see that TestA has appeared, and the operations such as query modification are normal. The backup recovery and recovery are successful.

Experiment conclusion: MySQL's database can be saved and backed up in file form. Recovery is done by just restoring the corresponding file directory without using other tools to back up.

12Next pageRead the full text