> I am running MySQL on Redhat and when I use the script that > comes with MySQL > (mysql.server) or safe_mysqld the command runs and starts the server. > However; the prompt does not return. I have to switch > consoles. (bash) > Does anyone have any idea how I can avoid this? (the script > from the rpm is > not an option in this particular case).
I'm confused... mysql.server IS the script that comes with the RedHat RPMs, at least on my machine. Maybe there is some problem with yours. Here is the one from my system that works fine if I run it as: mysql.server start or if you run mysqld_safe you are putting an ampersand after the command mysqld_safe & to send it to the background, right? ***mysql.server** # Comments to support chkconfig on RedHat Linux # chkconfig: 2345 90 90 # description: A very fast and reliable SQL database engine. # The following variables are only set for letting mysql.server find things. # If you want to affect other MySQL variables, you should make your changes # in the /etc/my.cnf or other configuration files. PATH=/sbin:/usr/sbin:/bin:/usr/bin export PATH # Set some defaults datadir=/var/lib/mysql basedir= pid_file= if test -z "$basedir" then basedir=/ bindir=/usr/bin else bindir="$basedir/bin" fi if test -z "$pid_file" then pid_file=$datadir/`/bin/hostname`.pid else case "$pid_file" in /* ) ;; * ) pid_file="$datadir/$pid_file" ;; esac fi mode=$1 # start or stop parse_arguments() { for arg do case "$arg" in --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --datadir=*) datadir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --pid-file=*) pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; esac done } # Get arguments from the my.cnf file, groups [mysqld] and [mysql_server] if test -x ./bin/my_print_defaults then print_defaults="./bin/my_print_defaults" elif test -x $bindir/my_print_defaults then print_defaults="$bindir/my_print_defaults" elif test -x $bindir/mysql_print_defaults then print_defaults="$bindir/mysql_print_defaults" else # Try to find basedir in /etc/my.cnf conf=/etc/my.cnf print_defaults= if test -r $conf then subpat='^[^=]*basedir[^=]*=\(.*\)$' dirs=`sed -e "/$subpat/!d" -e 's//\1/' $conf` for d in $dirs do d=`echo $d | sed -e 's/[ ]//g'` if test -x "$d/bin/my_print_defaults" then print_defaults="$d/bin/my_print_defaults" break fi if test -x "$d/bin/mysql_print_defaults" then print_defaults="$d/bin/mysql_print_defaults" break fi done fi # Hope it's in the PATH ... but I doubt it test -z "$print_defaults" && print_defaults="my_print_defaults" fi parse_arguments `$print_defaults $defaults mysqld mysql_server` # Safeguard (relative paths, core dumps..) cd $basedir case "$mode" in 'start') # Start daemon if test -x $bindir/mysqld_safe then # Give extra arguments to mysqld with the my.cnf file. This script may # be overwritten at next upgrade. $bindir/mysqld_safe --datadir=$datadir --pid-file=$pid_file & # Make lock for RedHat / SuSE if test -w /var/lock/subsys then touch /var/lock/subsys/mysql fi else echo "Can't execute $bindir/mysqld_safe" fi ;; 'stop') # Stop daemon. We use a signal here to avoid having to know the # root password. if test -s "$pid_file" then mysqld_pid=`cat $pid_file` echo "Killing mysqld with pid $mysqld_pid" kill $mysqld_pid # mysqld should remove the pid_file when it exits, so wait for it. sleep 1 while [ -s $pid_file -a "$flags" != aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ] do [ -z "$flags" ] && echo "Wait for mysqld to exit\c" || echo ".\c" flags=a$flags sleep 1 done if [ -s $pid_file ] then echo " gave up waiting!" elif [ -n "$flags" ] then echo " done" fi # delete lock for RedHat / SuSE if test -f /var/lock/subsys/mysql then rm /var/lock/subsys/mysql fi else echo "No mysqld pid file found. Looked for $pid_file." fi ;; *) # usage echo "usage: $0 start|stop" exit 1 ;; esac *** c -- Chris Lott http://www.chrislott.org/ --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php