A simple request - add SQL file to Resources section
Posted: Sat Jan 25, 2014 2:31 pm
There's a SQL file Thrydwolf wrote on the Wiki for automating the process of building the DB for the server. Is there anyway that can be included in the Resources section of the phpbb site, or maybe dropped into the Custom Tools and Application section for easier access? I'll quote it so it's easy,
@ECHO OFF
REM =============================================================================
REM =============================================================================
REM ====== =========
REM ====== THis script will drop the DB specificed, then create the DB =========
REM ====== specified, and then load all .sql tables from its run dir to =========
REM ====== the the DB. =========
REM ====== =========
REM ====== File needs to be run from within the \dsp\sql folder (same =========
REM ====== folder with all the .sql files. Please edit as needed. By =========
REM ====== default it WILL DROP the standard dspdb DB, loosing all =========
REM ====== accounts and characters. If this is not desired, then update =========
REM ====== the file to load the new DB into a new DB name. =========
REM ====== =========
REM ====== Update -p with MySQL password. If you password is 'foo', =========
REM ====== then change '-pMYSQLPASS' to '-pfoo' (3 places). =========
REM ====== =========
REM ====== If you want to use a different database name, change 'dspdb' =========
REM ====== with a database name of your choosing. =========
REM ====== =========
REM =============================================================================
REM =============================================================================
REM ====== =========
REM ====== by Thrydwolf 9/8/2012 =========
REM ====== Updated with status by bluekirby0 3/30/2012 =========
REM ====== Updated by Thrydwolf 9/18/2012 =========
REM ====== =========
REM =============================================================================
REM =============================================================================
ECHO Creating Database dspdb
mysqladmin -h localhost -u root -pMYSQLPASS DROP dspdb
ECHO Creating Database dspdb
mysqladmin -h localhost -u root -pMYSQLPASS CREATE dspdb
ECHO Loading dspdb with tables
REM FOR %%X IN (*.sql) DO mysql dspdb -h localhost -u root -pMYSQLPASS < %%X
FOR %%X IN (*.sql) DO ECHO Importing %%X & mysql dspdb -h localhost -u root -pMYSQLPASS < %%X
ECHO Finished!
@ECHO OFF
REM =============================================================================
REM =============================================================================
REM ====== =========
REM ====== THis script will drop the DB specificed, then create the DB =========
REM ====== specified, and then load all .sql tables from its run dir to =========
REM ====== the the DB. =========
REM ====== =========
REM ====== File needs to be run from within the \dsp\sql folder (same =========
REM ====== folder with all the .sql files. Please edit as needed. By =========
REM ====== default it WILL DROP the standard dspdb DB, loosing all =========
REM ====== accounts and characters. If this is not desired, then update =========
REM ====== the file to load the new DB into a new DB name. =========
REM ====== =========
REM ====== Update -p with MySQL password. If you password is 'foo', =========
REM ====== then change '-pMYSQLPASS' to '-pfoo' (3 places). =========
REM ====== =========
REM ====== If you want to use a different database name, change 'dspdb' =========
REM ====== with a database name of your choosing. =========
REM ====== =========
REM =============================================================================
REM =============================================================================
REM ====== =========
REM ====== by Thrydwolf 9/8/2012 =========
REM ====== Updated with status by bluekirby0 3/30/2012 =========
REM ====== Updated by Thrydwolf 9/18/2012 =========
REM ====== =========
REM =============================================================================
REM =============================================================================
ECHO Creating Database dspdb
mysqladmin -h localhost -u root -pMYSQLPASS DROP dspdb
ECHO Creating Database dspdb
mysqladmin -h localhost -u root -pMYSQLPASS CREATE dspdb
ECHO Loading dspdb with tables
REM FOR %%X IN (*.sql) DO mysql dspdb -h localhost -u root -pMYSQLPASS < %%X
FOR %%X IN (*.sql) DO ECHO Importing %%X & mysql dspdb -h localhost -u root -pMYSQLPASS < %%X
ECHO Finished!