[BATCH] Trinity SQL Importer

I have a small tool, but usefully for me and i want to share with the community.Is a batch file which import all SQL’s updates to world, char and auth database.No more combine only copy and paste the sql updates to right folder’s and run tool to have the job done for you.

P.S: If you have problems please read the README.txt before ask me for help.

The tool download link : Trinity Multiple SQL Importer

And small tanks is useful sometimes.

@echo off

echo.

color 9

echo Please enter your MySQL info:

echo If this information is not correct

echo the import will not work…

echo You may modify this script however you want

echo.

set /p host= MySQL Server Address (Default = localhost):

if %host%. == . set host=localhost

set /p user= MySQL Username (Default = root):

if %user%. == . set user=root

set /p pass= MySQL Password (Default = ):

if %pass%. == . set pass=

set /p world_db= Trinity World Database (Default = world):

if %world_db%. == . set world_db=world

set /p chars_db= Characters Database (Default = characters):

if %chars_db%. == . set chars_db=characters

set /p realmd_db= Realmd Database (Default = auth):

if %realmd_db%. == . set realmd_db=auth

set port=3306

set trinitysql=.\world_updates\

set realmdsql=.\auth_updates\

set charsql=.\characters_updates\

set mysqlpath=.\mysql\

:main

CLS

echo.

echo _______ _ _ _ _____ ____ _

echo #__ __# () () # / ____#/ __ # #

echo # #_ __ _ _ __ # # _ # (__ # # # # #

echo # # '__# # '_ # # # # # #_ # # # # #

echo # # # # # # # # # ## ## #) # #__# # #

echo ### ### ###_#_, #/ _____#

echo __/ #

echo #___/

echo.

echo _____ _

echo #_ _# # #

echo # # _ __ ___ _ __ ___ _ _# # ___ _ __

echo # # # '_ ` _ # '_ \ / _ # '__# #/ _ \ '#

echo # ## # # # # # #) # () # # # #_# __/ #

echo ### ## #_# ./ _/## _#__#_#

echo # #

echo #_#

ECHO Trinity SQL Importer.

echo Note: Please refer to the README.txt

echo if you have not read it before

echo else this will surely fail.

echo -----------

Echo Main Menu

echo -----------

ECHO.

echo c - Trinity Character Database update(s)

echo r - Trinity Auth Database update(s)

echo u - Trinity World Database update(s)

echo z - Reconfigure Mysql Information

echo x - Close the program

echo.

set /p v= Enter a letter:

if %v%==* goto error

if %v%==c goto chars

if %v%==C goto chars

if %v%==r goto realmd

if %v%==R goto realmd

if %v%==u goto updates

if %v%==U goto updates

if %v%==z goto top

if %v%==Z goto top

if %v%==x goto close

if %v%==X goto close

set v=

goto error

:close

CLS

EXIT

:chars

CLS

echo.

echo Importing Trinity Character Database update(s)…

echo.

for %%C in (%charsql%*.sql) do (

echo import: %%~nxC

%mysqlpath%\mysql --host=%host% --user=%user% --password=%pass% --port=%port% %chars_db% < “%%~fC”

)

echo.

echo Done.

echo.

echo Press any key to return to the main menu.

pause >NUL

goto main

:updates

CLS

echo.

echo Importing Trinity World Database update(s)…

echo.

for %%C in (%trinitysql%*.sql) do (

echo import: %%~nxC

%mysqlpath%\mysql --host=%host% --user=%user% --password=%pass% --port=%port% %world_db% < “%%~fC”

)

echo.

echo Done.

echo.

echo Press any key to return to the main menu.

pause >NUL

goto main

:realmd

CLS

echo.

echo Importing Trinity Auth Database update(s)…

echo.

for %%C in (%realmdsql%*.sql) do (

echo import: %%~nxC

%mysqlpath%\mysql --host=%host% --user=%user% --password=%pass% --port=%port% %realmd_db% < “%%~fC”

)

echo.

echo Done.

echo.

echo Press any key to return to the main menu.

pause >NUL

goto main

:error

CLS

echo.

echo Please enter the correct letter.

echo.

echo Press any key to go back and start again.

pause >NUL

goto main[/code][/CODE]

thanks, this is usefull^^

thanks for sharing

Warning: Unsafe Website Blocked!filebeam.com

This website has been blocked temporarily because of the following reason(s):

  • Malware: Site may contain content that is harmful, illegal, or malicious to your computer

Yea…

Why can’t you just publish the source code if this is a batch file? Its much easier