From: dms Date: Sat, 16 Sep 2000 13:23:08 +0000 (+0000) Subject: another attempt for a fix X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=942be7dada94255d12a7fbf4f4a68b65647b55fa;p=infobot.git another attempt for a fix git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@102 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/scripts/setup_sql.pl b/scripts/setup_sql.pl index f7c66e3..8cf13d2 100755 --- a/scripts/setup_sql.pl +++ b/scripts/setup_sql.pl @@ -51,6 +51,11 @@ if ($param{'DBType'} =~ /mysql/i) { $db{$_} = 1; } + # create database. + &status("Creating database $param{'DBName'}..."); + $query = "CREATE DATABASE $param{'DBName'}"; + &dbRaw("create(db $param{'DBName'})", $query); + # Step 4. print "Step 4: Creating the tables.\n"; @@ -192,19 +197,16 @@ if ($param{'DBType'} =~ /mysql/i) { # grant. &status(" Granting user access to table."); - $query = "GRANT SELECT,INSERT,UPDATE,DELETE ON $dbname TO $param{'SQLUser'}"; - &dbRaw("??", $query); + foreach ("factoids","seen","freshmeat") { + $query = "GRANT SELECT,INSERT,UPDATE,DELETE ON $dbname.$_ TO $param{'SQLUser'}"; + &dbRaw("GRANT", $query); + } # flush. &status("Flushing privileges..."); $query = "FLUSH PRIVILEGES"; # DOES NOT WORK on slink? &dbRaw("mysql(flush)", $query); - # create database. - &status("Creating database $param{'DBName'}..."); - $query = "CREATE DATABASE $param{'DBName'}"; - &dbRaw("create(db $param{'DBName'})", $query); - } elsif ($param{'DBType'} =~ /pgsql|postgres/i) { if ($param{'DBType'} =~ /pgsql|postgres/i) { use Pg; } # for runtime. my $dbh = Pg::connectdb("dbname=$dbname");