#!/bin/sh
USAGE="Usage: make_mysql_user <dbuser> <dbpsswd>"
HOSTNAME=`hostname`

if [ $# -ne 2 ] 
then
 echo $USAGE
 exit 1;
fi 


/usr/local/mysql/bin/mysql -uroot -p mysql <<EOF
INSERT user values ('localhost','$1', PASSWORD('$2'), 'Y','Y','Y','Y','Y','Y','Y','N','Y','N','N','Y','Y','Y');
INSERT user values ('$HOSTNAME','$1', PASSWORD('$2'), 'Y','Y','Y','Y','Y','Y','Y','N','Y','N','N','Y','Y','Y');
FLUSH PRIVILEGES
EOF

