Home Database Mysql Tutorial How to realize automatic scheduled backup of mysql database under windows server

How to realize automatic scheduled backup of mysql database under windows server

Jun 28, 2017 pm 02:01 PM
mysql windows server

There are many methods on the Internet about automatic backup of Mysql under window, but few of them are really usable. Some of them are very complicated and difficult to operate. Here is the editor of Script House. We have shared and compiled several software for everyone to use

There are many methods on the Internet about automatic backup of Mysql under windows, but few of them are really usable. Some of them are 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 can we automatically backup mysql?

Teach you the simplest method.

This method is done using bat batch processing.

Imaginary environment: MySQL Installation Location: D:\Program Files\MySQL\MySQL Server 5.0\data

As shown in the picture:

The database name is: 952game database backup destination: d:\db_bak\ (the path to which disk you want to back up the database to) I If you want to prepare it under the db-bak directory of the D drive================================== Create a new db_bak.bat and write the following code

net stop mysql
xcopy c:\mysql\data\bbs\*.* d:\db_bak\bbs\%date:~0,3%\ /y
net start mysql
Copy after login

Detailed explanation in the picture:

The best step is to implement regular backup, learn from me! GO go go

Here we use the simplest method

Use Windows' "Scheduled Tasks" to execute the batch script regularly. (For example: execute back_db.bat at 3 am every day)

If you don’t know how, please see the picture and text:

1. Run and schedule tasks

2. Add scheduled tasks.

#3. The last step is to specify the backup time.

Now you have completed the automatic scheduled backup, it is very simple.

Finally, the editor will tell you one more thing in the morning: this batch processing command\%date:~0,3% means to extract the day of the week information
Of course, if you want to create the year, month and day, use it %date:~0,10% , the system will create a date directory for you every day. It's very convenient.

%date:~0,10% //Extract the year, month and day information
%date:~-3% //Extract the day of the week information
%time:~ 0,5% //Extract hours and minutes from the time
%time:~0,-3% //Extract hours, minutes and seconds information

Domestic Windows server users can use:

Guardian God backup software free version (sqlserver, automatic file backup)

Please use the platform p8net mysql management tool MyAdmin v1.0 (mysql scheduled backup tool)

The above is the detailed content of How to realize automatic scheduled backup of mysql database under windows server. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1659
14
PHP Tutorial
1258
29
C# Tutorial
1232
24
Laravel Introduction Example Laravel Introduction Example Apr 18, 2025 pm 12:45 PM

Laravel is a PHP framework for easy building of web applications. It provides a range of powerful features including: Installation: Install the Laravel CLI globally with Composer and create applications in the project directory. Routing: Define the relationship between the URL and the handler in routes/web.php. View: Create a view in resources/views to render the application's interface. Database Integration: Provides out-of-the-box integration with databases such as MySQL and uses migration to create and modify tables. Model and Controller: The model represents the database entity and the controller processes HTTP requests.

MySQL and phpMyAdmin: Core Features and Functions MySQL and phpMyAdmin: Core Features and Functions Apr 22, 2025 am 12:12 AM

MySQL and phpMyAdmin are powerful database management tools. 1) MySQL is used to create databases and tables, and to execute DML and SQL queries. 2) phpMyAdmin provides an intuitive interface for database management, table structure management, data operations and user permission management.

MySQL vs. Other Programming Languages: A Comparison MySQL vs. Other Programming Languages: A Comparison Apr 19, 2025 am 12:22 AM

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages ​​such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages ​​have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

Laravel framework installation method Laravel framework installation method Apr 18, 2025 pm 12:54 PM

Article summary: This article provides detailed step-by-step instructions to guide readers on how to easily install the Laravel framework. Laravel is a powerful PHP framework that speeds up the development process of web applications. This tutorial covers the installation process from system requirements to configuring databases and setting up routing. By following these steps, readers can quickly and efficiently lay a solid foundation for their Laravel project.

Solve MySQL mode problem: The experience of using the TheliaMySQLModesChecker module Solve MySQL mode problem: The experience of using the TheliaMySQLModesChecker module Apr 18, 2025 am 08:42 AM

When developing an e-commerce website using Thelia, I encountered a tricky problem: MySQL mode is not set properly, causing some features to not function properly. After some exploration, I found a module called TheliaMySQLModesChecker, which is able to automatically fix the MySQL pattern required by Thelia, completely solving my troubles.

laravel installation code laravel installation code Apr 18, 2025 pm 12:30 PM

To install Laravel, follow these steps in sequence: Install Composer (for macOS/Linux and Windows) Install Laravel Installer Create a new project Start Service Access Application (URL: http://127.0.0.1:8000) Set up the database connection (if required)

Explain the purpose of foreign keys in MySQL. Explain the purpose of foreign keys in MySQL. Apr 25, 2025 am 12:17 AM

In MySQL, the function of foreign keys is to establish the relationship between tables and ensure the consistency and integrity of the data. Foreign keys maintain the effectiveness of data through reference integrity checks and cascading operations. Pay attention to performance optimization and avoid common errors when using them.

How to safely store JavaScript objects containing functions and regular expressions to a database and restore? How to safely store JavaScript objects containing functions and regular expressions to a database and restore? Apr 19, 2025 pm 11:09 PM

Safely handle functions and regular expressions in JSON In front-end development, JavaScript is often required...

See all articles