Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::General > Archive::News

Archive::News Archive area for New's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-04-2002, 07:17 AM
theCoder
Sarnak
 
Join Date: Jan 2002
Posts: 90
Default

Excellent!

As a side note, for those of you running mysql on Linux, here's a script I've written that uses the information in your db.ini file to create and populate the database. It's meant to be run on the mysql server machine. It assumes the following things are already set up:
* db.ini is correct (correct username, password, database name) and the database name in db.ini isn't already in the database
* The data to populate the database is located in .sql files in a data subdirectory and they have no errors (like duplicate keys)

Anyway, here's the script:
Code:
$ cat makedb
#!/bin/bash

DBNAME=`cat db.ini | grep database | awk -F= '{print $2}'`
DBUSER=`cat db.ini | grep user     | awk -F= '{print $2}'`
DBPASS=`cat db.ini | grep password | awk -F= '{print $2}'`

# first create the DB
echo "Creating database $DBNAME... enter mysql root password if prompted"
echo \
"create database $DBNAME;
 grant all on $DBNAME.* TO $DBUSER IDENTIFIED BY '$DBPASS';" | mysql -uroot -p

# now populate it
echo "Populating database $DBNAME..."
cat data/*.sql | mysql -u$DBUSER -p$DBPASS $DBNAME
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:42 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3