$OpenBSD: patch-scripts_mysql_install_db_sh,v 1.5 2007/01/25 07:41:48 jakob Exp $
--- scripts/mysql_install_db.sh.orig	Tue Jan  9 07:51:08 2007
+++ scripts/mysql_install_db.sh	Sun Jan 14 22:07:48 2007
@@ -10,7 +10,8 @@
 in_rpm=0
 windows=0
 defaults=""
-user=""
+user=_mysql
+group=_mysql
 
 case "$1" in
     --no-defaults|--defaults-file=*|--defaults-extra-file=*)
@@ -40,6 +41,7 @@ parse_arguments() {
         # as 'user' (crucial e.g. if log-bin=/some_other_path/
         # where a chown of datadir won't help)
 	 user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
+      --group=*) group=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
       --skip-name-resolve) ip_only=1 ;;
       --verbose) verbose=1 ;;
       --rpm) in_rpm=1 ;;
@@ -197,12 +199,10 @@ fi
 
 # Create database directories mysql & test
 
-  if test ! -d $ldata; then mkdir $ldata; chmod 700 $ldata ; fi
-  if test ! -d $ldata/mysql; then mkdir $ldata/mysql;  chmod 700 $ldata/mysql ; fi
-  if test ! -d $ldata/test; then mkdir $ldata/test;  chmod 700 $ldata/test ; fi
-  if test -w / -a ! -z "$user"; then
-    chown $user $ldata $ldata/mysql $ldata/test;
-  fi
+  if test ! -d $ldata; then mkdir -p $ldata; chmod 700 $ldata ; fi
+  if test ! -d $ldata/mysql; then mkdir -p $ldata/mysql;  chmod 700 $ldata/mysql ; fi
+  if test ! -d $ldata/test; then mkdir -p $ldata/test;  chmod 700 $ldata/test ; fi
+  chown -f $user:$group $ldata $ldata/mysql $ldata/test;
 
 if test ! -f $mdata/db.frm
 then
@@ -246,13 +246,6 @@ then
       echo ""
     fi
   fi
-  if test "$in_rpm" = 0 -a "$windows" = 0
-  then
-    echo ""
-    echo "To start mysqld at boot time you have to copy support-files/mysql.server"
-    echo "to the right place for your system"
-    echo
-  fi
   if test "$windows" -eq 0
   then
   echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !"
@@ -270,15 +263,6 @@ then
     echo "able to use the new GRANT command!"
   fi
   echo
-  if test "$in_rpm" = "0"
-  then
-    echo "You can start the MySQL daemon with:"
-    echo "cd @prefix@ ; $bindir/mysqld_safe &"
-    echo
-    echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:"
-    echo "cd sql-bench ; perl run-all-tests"
-    echo
-  fi
   echo "Please report any problems with the @scriptdir@/mysqlbug script!"
   echo
   echo "The latest information about MySQL is available on the web at"
