There are a lot of methods for automatic MySQL backup under windows on the Internet, but there are not a few that can be used, some of which are still very complicated and difficult to operate.
We all know that MSSQL itself comes with scheduled tasks that can be used for automatic backup,But how do we have automatic backups for mysql?
PC6 teaches you the simplest way.
This method is completed using bat batch processing.
Hypothetical environment:MySQL installation path: D: \ Program Files \ mysql \ MySQL Server 5.0 \ data
Database Name: 952game Database Backup destination: D: \ db_bak \ (path of the disk to which you want to back up the database) under the DB-Bak directory where I want to backup D, ======================== new db_bak.bat, write the following code
Net stop MySQL
Xcopy c: \ mysql \ data \ BBS \ *. * D: \ db_bak \ BBS \ % Date :~ 0, 3% \/y
Net start MySQL
Details:
The best step is to implement regular backup! Go go
Here we use the simplest method
Run the batch processing script on a scheduled task in windows. (For example, execute back_db.bat at every day)
If not, view the text:
1. Run and Schedule Tasks
2. Add a scheduled task.
3. The last step is to specify the backup time.
Now we have completed automatic and scheduled backup. It's easy.
Finally, the pc6.com editor will give you an additional explanation in the early morning. This batch processing command \ % Date :~ 0, 3% indicates the week information.
If you want to create a date, use % Date :~ At, the system will create a date directory for you every day. It's very convenient.
% Date :~ 0, 10% // extract year, month, and day Information
% Date :~ -3% // extract the day of the week
% Time :~ // Extract time and minute in time
% Time :~ 0,-3% // extract time and minute and second Information
If you still don't want to, come to pc6.com and ask us to edit it. Will answer your questions in detail. The most important thing is no charge! Haha. I think pc6 can help you forward it to your friends.