How to perform a backup of all databases in a folder
-
Hello friends how could I perform a backup of the database,
I want to have portable databases
-
-
@leokhoa ok thanks for the tip
-
@Storm-Code Create a .bat file and put this code in one line:
C:\laragon\bin\mysql\mariadb-10.1.19-win32\bin\mysql.exe -uroot -s -N -e "SHOW DATABASES" | for /F "usebackq" %%D in (`findstr /V "information_schema performance_schema"`) do C:\laragon\bin\mysql\mariadb-10.1.19-win32\bin\mysqldump.exe %%D -uroot > C:\db_backup\%%D.sql
Change paths according to your installation.
This will backup all your databases in a separate .sql file
-
@Noyan how to use .bat file