Headlines News :

Kamis, 22 Desember 2022

Print Friendly and PDF
{[[''],['']]}

Cara Backup Database XAMPP menggunakan batch script

Create a the folder c:\xampp\backup

Create the file mysql_all_databases.bat inside c:\xampp with the following contents

Note: sesuaikan lokasi dimana folder yang kalian buat

@ECHO OFF

set TIMESTAMP=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%

REM Export all databases into file C:\xampp\backup\databases.[year][month][day].sql
"C:\xampp\mysql\bin\mysqldump.exe" --all-databases --result-file="C:\xampp\backup\databases.%TIMESTAMP%.sql" --user=root

REM Change working directory to the location of the DB dump file.
C:
CD \xampp\backup\

REM Compress DB dump file into CAB file (use "EXPAND file.cab" to decompress).
MAKECAB "databases.%TIMESTAMP%.sql" "databases.%TIMESTAMP%.sql.cab"

REM Delete uncompressed DB dump file.
DEL /q /f "databases.%TIMESTAMP%.sql"
Related Posts Plugin for WordPress, Blogger...