37 lines
1.0 KiB
Batchfile
37 lines
1.0 KiB
Batchfile
|
@echo off
|
||
|
|
||
|
setlocal enabledelayedexpansion
|
||
|
|
||
|
set "mariadb_host=localhost"
|
||
|
set "mariadb_port=3306"
|
||
|
set "mariadb_user=root"
|
||
|
set "mariadb_password="
|
||
|
set "mysql_executable="
|
||
|
|
||
|
if exist Secrets.cmd (
|
||
|
call Secrets.cmd
|
||
|
)
|
||
|
|
||
|
for %%G in (8.0, 5.7, 5.6) do (
|
||
|
set "mysql_path=C:\Program Files\MySQL\MySQL Server %%G\bin\mysql.exe"
|
||
|
if exist !mysql_path! (
|
||
|
set "mysql_executable=!mysql_path!"
|
||
|
goto :break
|
||
|
)
|
||
|
)
|
||
|
:break
|
||
|
|
||
|
if "%mysql_executable%" == "" (
|
||
|
echo "Please, install MySQL 8.0 or 5.7."
|
||
|
) else (
|
||
|
for %%f in (20.base) do (
|
||
|
echo %cd%\..\MariaDB\AnPRM.4.%%f.my.sql
|
||
|
"%mysql_executable%" --host=%mariadb_host% --port=%mariadb_port% --user=%mariadb_user% --password=%mariadb_password% < %cd%\..\MariaDB\AnPRM.4.%%f.my.sql
|
||
|
)
|
||
|
for /D %%d in (%cd%\..\MariaDB\AnPRM.5.*) do (
|
||
|
for %%f in (%%d\*.sql) do (
|
||
|
echo %%f
|
||
|
"%mysql_executable%" --host=%mariadb_host% --port=%mariadb_port% --user=%mariadb_user% --password=%mariadb_password% < %%f
|
||
|
)
|
||
|
)
|
||
|
)
|