XAMPP MySQL Backup for Windows v1.0 by Steven Graham is a batch script that allows you to easily back up all MySQL databases on your local XAMPP server. It offers an option to back up either all databases (including system schemas) or only user-created databases (excluding system schemas and phpMyAdmin).
- Simple to Use: Just run the script and follow the prompts.
- Flexible Backup Options: Choose between backing up all databases or only user-created databases.
- Automatic Timestamp: Backup file names are automatically generated with a timestamp in
YYYYMMDD-HHMMSS
format. - XAMPP Path Flexibility: Specify a custom XAMPP path or use the default (
C:\xampp
).
- Windows OS
- XAMPP installed
- MySQL databases hosted on XAMPP
- Download the script
backup.bat
from this repository. - Save the script in the backup destination folder.
- Run the Script: Double-click
backup.bat
or run it from the command prompt. - Enter the XAMPP Path: You will be prompted to enter the path to your XAMPP installation. The default is
C:\xampp
, so you can press Enter if this is correct. - Enter MySQL Password: You will be prompted to enter the MySQL root password. If no password is set, simply press Enter.
- Select Backup Type: You will be prompted to choose the type of backup:
1
for all databases (including system schemas).2
for only user-created databases (excluding system schemas and phpMyAdmin). The default option is1
.
- Backup File Created: The script will generate a backup file in the format
xampp_mysql_backup_YYYYMMDD-HHMMSS.sql
in the folder where the script is run.
XAMPP MySQL Backup for Windows v1.0 by Steven Graham
==================================================
Enter the path to XAMPP (default is C:\xampp): C:\xampp
Enter MySQL root password (press Enter for none):
Do you want to back up:
1. All databases (including system schemas) [default]
2. Only user-created databases (excluding system schemas and phpmyadmin)
Enter 1 or 2 (default is 1): 1
Backup complete! The dump is saved to xampp_mysql_backup_20241023-112758.sql
You can also run the script from the command prompt:
C:\path\to\backup.bat
.
├── backup.bat # Main script to back up MySQL databases
└── README.md # Documentation (this file)
- MySQL not found: Ensure you enter the correct path to your XAMPP installation. The MySQL binaries should be located in
C:\xampp\mysql\bin
or similar. - Access Denied: Ensure you have the correct MySQL root password, or that MySQL is running in XAMPP.
This project is open-source and free to use under the MIT License. See the LICENSE file for more information.