source: trunk/gsdl3/dist-resources/mysql-setup.sh@ 7840

Last change on this file since 7840 was 7840, checked in by kjdon, 20 years ago

scripts to setup mysql and load in the sample dbs for the installer

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 806 bytes
Line 
1#!/bin/sh
2
3gsdl3home=$1
4
5if [ "$gsdl3home" == "" ]; then
6 echo "Usage: $0 <gsdl3home>"
7 exit 1
8fi
9
10cd $gsdl3home
11
12# set up the sql db
13user=`whoami`
14pushd $gsdl3home/packages/mysql
15echo "installing mysql databases"
16./bin/mysql_install_db --datadir=$gsdl3home/packages/mysql/var --basedir=$gsdl3home/packages/mysql --user=$user
17echo "setting up the user priviledges"
18./bin/mysqld_safe --datadir=$gsdl3home/packages/mysql/var --basedir=$gsdl3home/packages/mysql --pid_file=$gsdl3home/packages/mysql/var/gsdl3.pid --err-log=$gsdl3home/packages/mysql/var/gsdl3.err &
19sleep 2
20./bin/mysql --user=root --execute="GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@localhost;"
21./bin/mysql --user=root --execute="GRANT SELECT ON *.* TO gsdl3reader@localhost;"
22
23popd
24./gs3-mysql-server.sh stop
Note: See TracBrowser for help on using the repository browser.