$OpenBSD: patch-scripts_mysql_install_db_sh,v 1.16 2019/08/05 19:48:49 sthen Exp $

Index: scripts/mysql_install_db.sh
--- scripts/mysql_install_db.sh.orig
+++ scripts/mysql_install_db.sh
@@ -30,7 +30,8 @@ args=""
 defaults=""
 defaults_group_suffix=""
 mysqld_opt=""
-user=""
+user=_mysql
+group=_mysql
 silent_startup="--silent-startup"
 
 force=0
@@ -150,6 +151,8 @@ parse_arguments()
         # as 'user' (crucial e.g. if log-bin=/some_other_path/
         # where a chown of datadir won't help)
         user=`parse_arg "$arg"` ;;
+      --group=*)
+        group=`parse_arg "$arg"` ;;
       --skip-name-resolve) ip_only=1 ;;
       --verbose) verbose=1 ; silent_startup="" ;;
       --rpm) in_rpm=1 ;;
@@ -458,11 +461,11 @@ do
   fi
   if test -n "$user"
   then
-    chown $user "$dir"
+    chown -f $user:$group "$dir"
     if test $? -ne 0
     then
-      echo "Cannot change ownership of the database directories to the '$user'"
-      echo "user.  Check that you have the necessary permissions and try again."
+      echo "Cannot change ownership of the database directories to '$user:$group'"
+      echo "user/group.  Check that you have the necessary permissions and try again."
       exit 1
     fi
   fi
@@ -564,10 +567,6 @@ fi
 # the screen.
 if test "$cross_bootstrap" -eq 0 && test -z "$srcdir"
 then
-  s_echo
-  s_echo "To start mysqld at boot time you have to copy"
-  s_echo "support-files/mysql.server to the right place for your system"
-
   if test "$auth_root_authentication_method" = normal
   then
     echo
@@ -594,10 +593,7 @@ then
   then
     echo
     echo "You can start the MariaDB daemon with:"
-    echo "cd '$basedir' ; $bindir/mysqld_safe --datadir='$ldata'"
-    echo
-    echo "You can test the MariaDB daemon with mysql-test-run.pl"
-    echo "cd '$basedir/mysql-test' ; perl mysql-test-run.pl"
+    echo "/etc/rc.d/mysqld start"
   fi
 
   echo
