Re: MySQL not starting at boot-Fedora Core 3
Hello. Are you able to start MySQL server by this command? service mysqld start I think you should put the correct values for the basedir, datadir, PATH variables at the beginning of the /etc/init.d/mysql file. Mark Sargent [EMAIL PROTECTED] wrote: Hi All, attempting another mysql install, on a 3rd machine. Extracted the tar.gz file to /usr/local/mysql. Followed the install docs here, http://dev.mysql.com/doc/mysql/en/installing-binary.html and successfully ran the MySql grant tables script, 6. If you haven't installed MySQL before, you must create the MySQL grant tables: shell scripts/mysql_install_db --user=mysql I then followed here, http://dev.mysql.com/doc/mysql/en/automatic-start.html to a T, and copied mysql.server to /etc/init.d, and just for good measure, gave it permission to execute, chmod +x /etc/init.d/mysql I then rebooted, to see how things would go at boot, and saw a failed message for mysqld_safe, Apr 16 21:20:01 localhost lsb_log_message: Can't execute ./bin/mysqld_safe failed Can anyone explain why it wouldn't start..? Anything I should be looking for..? I can start the server with ./mysqld_safe from within the bin dir and I can connect as root or mysql. Cheers. /etc/init.dmysql permissions [EMAIL PROTECTED] init.d]# ls -lh mysql -rwxr-xr-x 1 root root 6.2K Apr 16 21:11 mysql Mark Sargent. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.NET http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Gleb Paharenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.NET ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL not starting at boot-Fedora Core 3
Mark Sargent wrote: Andy Pieters wrote: Hi Try to see in the log files cat /var/log/mysqld or start the mysql server and then type tail /var/log/messages On Fedora, once you have properly installed mysql there is no need to reboot your system to test it. Just type /sbin/service mysql start other options you can use there: stop restart I have a MySql server on one of my machines that is running FC3 and I don't even have mysql_safe here. (Version 3.23.58) Andy Hi All, that's just the problem. It won't start that way. I had already checked the logs, but, it only seems to log things after starting, bringing me back to zero position, a server that won't start this way. Cheers. (It was safe_mysqld in mysql 3.) [EMAIL PROTECTED] ~]# /sbin/service mysql start Can't execute ./bin/mysqld_safe[FAILED] Your error message is right there -- Can't execute ./bin/mysqld_safe. If you look in mysql.server, you'll see cd $basedir case $mode in 'start') # Start daemon if test -x $bindir/mysqld_safe then # ... code to start the server ... else log_failure_msg Can't execute $bindir/mysqld_safe fi Clearly, ./bin/mysqld_safe is failing the -x test. As you previously reported that ./mysqld_safe works if you are in mysql's bin directory, we know that mysqld_safe is executable. Hence, when mysql.server tries to run ./bin/mysqld_safe, it must not be in the right directory. That is, it has the wrong value for $basedir. Perhaps you installed mysql somewhere other than the standard location? You could edit mysql.server to add an echo $basedir right before the cd, then run it by hand to you can see where the script thinks it should go. The fix will probably involve setting the basedir in /etc/my.cnf to the correct value. If that's not enough to get you going in the right direction, write back and let us know. Michael -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL not starting at boot-Fedora Core 3
Michael Stassen wrote: Mark Sargent wrote: Andy Pieters wrote: Hi Try to see in the log files cat /var/log/mysqld or start the mysql server and then type tail /var/log/messages On Fedora, once you have properly installed mysql there is no need to reboot your system to test it. Just type /sbin/service mysql start other options you can use there: stop restart I have a MySql server on one of my machines that is running FC3 and I don't even have mysql_safe here. (Version 3.23.58) Andy Hi All, that's just the problem. It won't start that way. I had already checked the logs, but, it only seems to log things after starting, bringing me back to zero position, a server that won't start this way. Cheers. (It was safe_mysqld in mysql 3.) Not sure what you mean there.. [EMAIL PROTECTED] ~]# /sbin/service mysql start Can't execute ./bin/mysqld_safe[FAILED] Your error message is right there -- Can't execute ./bin/mysqld_safe. If you look in mysql.server, you'll see cd $basedir case $mode in 'start') # Start daemon if test -x $bindir/mysqld_safe then # ... code to start the server ... else log_failure_msg Can't execute $bindir/mysqld_safe fi Clearly, ./bin/mysqld_safe is failing the -x test. As you previously reported that ./mysqld_safe works if you are in mysql's bin directory, we know that mysqld_safe is executable. Hence, when mysql.server tries to run ./bin/mysqld_safe, it must not be in the right directory. That is, it has the wrong value for $basedir. Perhaps you installed mysql somewhere other than the standard location? Nope, it is located here, /usr/local/mysql. You could edit mysql.server to add an echo $basedir right before the cd, then run it by hand to you can see where the script thinks it should go. The fix will probably involve setting the basedir in /etc/my.cnf to the correct value. Yes, I went and looked at the script, to see if something was wrong. I couldn't see anything out of order, although, I'm a novice at scripts(programming). If that's not enough to get you going in the right direction, write back and let us know. Hopefully it'll get me going. Cheers. Michael Mark Sargent. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
MySQL not starting at boot-Fedora Core 3
Hi All, attempting another mysql install, on a 3rd machine. Extracted the tar.gz file to /usr/local/mysql. Followed the install docs here, http://dev.mysql.com/doc/mysql/en/installing-binary.html and successfully ran the MySql grant tables script, 6. If you haven't installed MySQL before, you must create the MySQL grant tables: shell scripts/mysql_install_db --user=mysql I then followed here, http://dev.mysql.com/doc/mysql/en/automatic-start.html to a T, and copied mysql.server to /etc/init.d, and just for good measure, gave it permission to execute, chmod +x /etc/init.d/mysql I then rebooted, to see how things would go at boot, and saw a failed message for mysqld_safe, Apr 16 21:20:01 localhost lsb_log_message: Can't execute ./bin/mysqld_safe failed Can anyone explain why it wouldn't start..? Anything I should be looking for..? I can start the server with ./mysqld_safe from within the bin dir and I can connect as root or mysql. Cheers. /etc/init.dmysql permissions [EMAIL PROTECTED] init.d]# ls -lh mysql -rwxr-xr-x 1 root root 6.2K Apr 16 21:11 mysql Mark Sargent. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL not starting at boot-Fedora Core 3
Hi Try to see in the log files cat /var/log/mysqld or start the mysql server and then type tail /var/log/messages On Fedora, once you have properly installed mysql there is no need to reboot your system to test it. Just type /sbin/service mysql start other options you can use there: stop restart I have a MySql server on one of my machines that is running FC3 and I don't even have mysql_safe here. (Version 3.23.58) Andy -- Registered Linux User Number 379093 -- --BEGIN GEEK CODE BLOCK- Version: 3.1 GAT/O/E$ d-(---)+ s:(+): a--(-)? C$(+++) UL$ P-(+)++ L+++$ E---(-)@ W++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++) PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+) e$@ h++(*) r--++ y--() -- ---END GEEK CODE BLOCK-- -- Check out these few php utilities that I released under the GPL2 and that are meant for use with a php cli binary: http://www.vlaamse-kern.com/sas/ -- -- pgpAURHhrWK92.pgp Description: PGP signature
Re: MySQL not starting at boot-Fedora Core 3
Andy Pieters wrote: Hi Try to see in the log files cat /var/log/mysqld or start the mysql server and then type tail /var/log/messages On Fedora, once you have properly installed mysql there is no need to reboot your system to test it. Just type /sbin/service mysql start other options you can use there: stop restart I have a MySql server on one of my machines that is running FC3 and I don't even have mysql_safe here. (Version 3.23.58) Andy Hi All, that's just the problem. It won't start that way. I had already checked the logs, but, it only seems to log things after starting, bringing me back to zero position, a server that won't start this way. Cheers. [EMAIL PROTECTED] ~]# /sbin/service mysql start Can't execute ./bin/mysqld_safe[FAILED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
mysql not starting at boot
Hi All, below is my /etc/init.d/mysql content, but, mysql is not starting at boot on Fedora3. Have I missed something fundamental.? I need mysql to start at boot for snort to connect to it. Currently, snort gives an error stating it can't connect. Cheers. Mark Sargent. [EMAIL PROTECTED] ~]# cat /etc/init.d/mysql #!/bin/sh # Copyright Abandoned 1996 TCX DataKonsult AB Monty Program KB Detron HB # This file is public domain and comes with NO WARRANTY of any kind # MySQL daemon start/stop script. # Usually this is put in /etc/init.d (at least on machines SYSV R4 based # systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql. # When this is done the mysql server will be started when the machine is # started and shut down when the systems goes down. # Comments to support chkconfig on RedHat Linux # chkconfig: 2345 90 20 # description: A very fast and reliable SQL database engine. # Comments to support LSB init script conventions ### BEGIN INIT INFO # Provides: mysql # Required-Start: $local_fs $network $remote_fs # Required-Stop: $local_fs $network $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: start and stop MySQL # Description: MySQL is a very fast and reliable SQL database engine. ### END INIT INFO # If you install MySQL on some other places than /usr/local/mysql, then you # have to do one of the following things for this script to work: # # - Run this script from within the MySQL installation directory # - Create a /etc/my.cnf file with the following information: # [mysqld] # basedir=path-to-mysql-installation-directory # - Add the above to any other configuration file (for example ~/.my.ini) # and copy my_print_defaults to /usr/bin # - Add the path to the mysql-installation-directory to the basedir variable # below. # # If you want to affect other MySQL variables, you should make your changes # in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files. basedir= # The following variables are only set for letting mysql.server find things. # Set some defaults datadir=/usr/local/mysql/data pid_file= if test -z $basedir then basedir=/usr/local/mysql bindir=./bin else bindir=$basedir/bin fi PATH=/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin export PATH mode=$1# start or stop case `echo testing\c`,`echo -n testing` in *c*,-n*) echo_n= echo_c= ;; *c*,*) echo_n=-n echo_c= ;; *) echo_n= echo_c='\c' ;; esac 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] [mysql_server] 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 # # Test if someone changed datadir; In this case we should also read the # default arguments from this directory # extra_args= if test $datadir != /usr/local/mysql/data then extra_args=-e $datadir/my.cnf fi parse_arguments `$print_defaults $extra_args mysqld server mysql_server mysql.se rver` # # Set pid file if not given # if test -z $pid_file then pid_file=$datadir/`/bin/hostname`.pid else case $pid_file in /* ) ;; * ) pid_file=$datadir/$pid_file ;; esac fi # 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 /dev/null 2 1 # 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 from dir $basedir 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
RE: mysql not starting at boot
On Wednesday, March 30, 2005 23:26, Mark Sargent wrote: Hi All, below is my /etc/init.d/mysql content, but, mysql is not starting at boot on Fedora3. Have I missed something fundamental.? I need mysql to start at boot for snort to connect to it. Currently, snort gives an error stating it can't connect. Cheers. Mark Sargent. I assume you are able to start it after boot using 'service mysql start'. Run: chkconfig --list mysql This should show a list of runlevels with on and off. If not run: chkconfig --add mysql -- Tom Crimmins Interface Specialist Pottawattamie County, Iowa -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: mysql not starting at boot
Tom Crimmins wrote: On Wednesday, March 30, 2005 23:26, Mark Sargent wrote: Hi All, below is my /etc/init.d/mysql content, but, mysql is not starting at boot on Fedora3. Have I missed something fundamental.? I need mysql to start at boot for snort to connect to it. Currently, snort gives an error stating it can't connect. Cheers. Mark Sargent. I assume you are able to start it after boot using 'service mysql start'. Run: chkconfig --list mysql This should show a list of runlevels with on and off. If not run: chkconfig --add mysql Hi All, thanx, that did it. Cheers. Mark Sargent. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: mysql not starting at boot
To have mysql to start at boot you need to inform the inetd (daemon) that mysql should be launched at one of the 6 levels: Use chkconfig to have mysql start in one of the level (2,3,4,5,6) 5 being X windows. There are two ways to check that mysql will be loaded: - 1 - by checking the file in /etc/rc.d/rcX.d (X being a number: 1,2,3,4,5,6) - 2 - by executing chkconfig execute the following to see if mysql runs at any level /sbin/chkconfig --list | grep mysql you should see at which level mysql is running. mysql 0:off 1:off 2:off 3:off 4:off 5:off 6:off If it is all off then execute: /sbin/chkconfig --level 2345 mysql on (this will make sure that mysql runs at level 2, 3, 4 and 5) On my machine (Fedora 2) it runs at 2,3,4 and 5. Once you have it run at a level you can verify it by looking at rcX.d (X being a level): for example to check that it runs at level 4: go to /etc/rc.d/rc4.d/ and look at a file named ...mysql S20mysql (S means it will be picked up by the inetd daemon) K30mysql (K means Kill and mysql wont start) good luck Laurie On Wednesday 30 March 2005 09:26 pm, Mark Sargent wrote: Hi All, below is my /etc/init.d/mysql content, but, mysql is not starting at boot on Fedora3. Have I missed something fundamental.? I need mysql to start at boot for snort to connect to it. Currently, snort gives an error stating it can't connect. Cheers. Mark Sargent. [EMAIL PROTECTED] ~]# cat /etc/init.d/mysql #!/bin/sh # Copyright Abandoned 1996 TCX DataKonsult AB Monty Program KB Detron HB # This file is public domain and comes with NO WARRANTY of any kind # MySQL daemon start/stop script. # Usually this is put in /etc/init.d (at least on machines SYSV R4 based # systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql. # When this is done the mysql server will be started when the machine is # started and shut down when the systems goes down. # Comments to support chkconfig on RedHat Linux # chkconfig: 2345 90 20 # description: A very fast and reliable SQL database engine. # Comments to support LSB init script conventions ### BEGIN INIT INFO # Provides: mysql # Required-Start: $local_fs $network $remote_fs # Required-Stop: $local_fs $network $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: start and stop MySQL # Description: MySQL is a very fast and reliable SQL database engine. ### END INIT INFO # If you install MySQL on some other places than /usr/local/mysql, then you # have to do one of the following things for this script to work: # # - Run this script from within the MySQL installation directory # - Create a /etc/my.cnf file with the following information: # [mysqld] # basedir=path-to-mysql-installation-directory # - Add the above to any other configuration file (for example ~/.my.ini) # and copy my_print_defaults to /usr/bin # - Add the path to the mysql-installation-directory to the basedir variable # below. # # If you want to affect other MySQL variables, you should make your changes # in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files. basedir= # The following variables are only set for letting mysql.server find things. # Set some defaults datadir=/usr/local/mysql/data pid_file= if test -z $basedir then basedir=/usr/local/mysql bindir=./bin else bindir=$basedir/bin fi PATH=/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin export PATH mode=$1# start or stop case `echo testing\c`,`echo -n testing` in *c*,-n*) echo_n= echo_c= ;; *c*,*) echo_n=-n echo_c= ;; *) echo_n= echo_c='\c' ;; esac 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] [mysql_server] 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 # # Test if someone changed datadir; In