#!/bin/sh
echo "please input Resserveraddress: "
read Resserver
echo "please input Gameserveraddress: "
read GameServer
path=`pwd`
mysql -u root <<QUERY_SQL
DROP DATABASE IF EXISTS test;
DROP DATABASE IF EXISTS testLog;
DROP DATABASE IF EXISTS test;
CREATE DATABASE test;
CREATE DATABASE gameLog;
DELETE FROM mysql.user WHERE host='localhost.localdomain';
DELETE FROM mysql.user WHERE host='127.0.0.1';
DELETE FROM mysql.user WHERE user='';
USE test;
source $path/test.sql;
USE gameLog;
source $path/testLog.sql;
grant all on test.* to " identified by "password";
grant all on testLog.* to ";
grant all on test.tbl_sch_account to " identified by "password";
grant all on testLog.* to " identified by "password";
grant all on testLog.* to " identified by "password";
insert into test.tbl_sch_account(email,password) values('test1',md5('111111'));
insert into test.tbl_sch_account(email,password) values('test2',md5('111111'));
insert into test.tbl_sch_account(email,password) values('test3',md5('111111'));
insert into test.tbl_sch_account(email,password) values('test4',md5('111111'));
insert into test.tbl_sch_account(email,password) values('test5',md5('111111'));
select * from test.tbl_sch_account;
show grants;
show grants for " ";
show grants for " ";
UPDATE mysql.user SET Password=PASSWORD ('password') WHERE User='root';
QUIT
QUERY_SQL