Skip navigation links

User Comments

Posted by [name withheld] on July 29 2003 12:21pm[Delete] [Edit]

Remember that on FreeBSD or any *nix system that supports running scripts from /usr/local/etc/rc.d
you should do for security purposes:
#chmod 100 *

Posted by Steven Casey on September 9 2003 7:35pm[Delete] [Edit]

Running Mandrake Linux 9.1/MySQL 4.x: Following the instructions for auto-start didn't work. Drove me crazy until I created the startup symbolic link in the rc5.d instead of rc3.d.

If you need to boot without graphics or just level 3, then put the symbolic link to mysql.server in rc3.d

Posted by Mongo Mongoson on March 26 2004 11:41am[Delete] [Edit]

Slackware 8 MySQL 4 autostart instructions:

I installed MySQL 4.0.18 on Slackware v8. The "auto-start" instructions don't seem to apply to Slackware. I ended up adding this to my /etc/rc.d/rc.M:

# Start MySQL server:
if [ -x /etc/rc.d/rc.mysql ]; then
. /etc/rc.d/rc.mysql start
fi

then I added this to /etc/rc.d/rc.K above the #Kill all processes line:

# Shut down the MySQL database server
if [ -x /etc/rc.d/rc.mysql ]; then
. /etc/rc.d/rc.mysql stop
fi

Then I created the /etc/rc.d/rc.mysql script:

#!/bin/sh
#
# Start the MySQL database server
#

case "$1" in
'start')
/usr/local/mysql/support-files/mysql.server start ;;
'stop')
/usr/local/mysql/support-files/mysql.server stop ;;
'restart')
/usr/local/mysql/support-files/mysql.server restart ;;
*)
echo "usage $0 start|stop|restart" ;;
esac

That got me going and seems to work fine. If there's a real pro out there who knows a nicer/more correct way please let me know at cuculi54986@yahoo.com -- Jon Reed

Posted by Gabriel Barazer on October 12 2004 2:14pm[Delete] [Edit]

I run a linux 2.6 server with only MySQL running (P4 3.2Ghz / 2GB) and sometimes (mainly when the server has run for a little time ,when it has reached an uptime of...30 minutes to few days), it becomes impossible to stop it with the right signal, or with mysqladmin (mysqladmin shutdown, or mysql.server stop). Mysql.server says it gaves up waiting and mysqladmin freeze too. nothing helpful in the error log, and finally i have to send a KILL signal to stop it. I've got this problem with all mysql 4 & 4.1 versions...

So to avoid a reboot failure (if the mysql.server script doesn't stop mysqld), it's better to add a kill command (which send SIGKILL to mysqld) in the mysql.server script after the waiting loop.

Posted by [name withheld] on December 11 2005 7:11pm[Delete] [Edit]

On Slackware 10, just copy mysql.server to /etc/rc.d and rename it to rc.mysqld

cp /usr/local/mysql/support-files/mysql.server /etc/rc.d/rc.mysqld

Posted by Wade Smith on January 19 2006 5:33pm[Delete] [Edit]

On FreeBSD 5.x according to the mysql-server.sh file installed automatically with the ports collection for 4.1.16, you have to add the line in your rc.conf to have automatic startup for mysqld:

mysql_enable="YES"

Don't know if this helps but I had to make the connect during post port installation to get mine to always come up without manual intervention.

Posted by Sergio Tam on June 5 2006 2:38pm[Delete] [Edit]

En FreeBsd para arrancar mysql después de instalarlo
editar el archivo /etc/rc.conf y agregar las siguiente linea mysql_enable="YES"
y después en la consola terminal ejecutas el siguiente comando /usr/local/etc/rc.d/mysql-server.sh start,
si lo haces todo en este orden no tendrás problemas para iniciar el servidor.
Si no agregas la linea en el rc.conf y ejecutas el siguiente comando /usr/local/etc/rc.d/mysql-server.sh start
te marcara el siguiente error Connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/temp/mysql.sock' exists!
Saludos

Posted by dennis pickering on March 4 2011 3:14pm[Delete] [Edit]

On Fedora 13, 3 yum installs were needed. The first two were not sufficient to load the normal init.d startup script. Third one did.

yum install mysql
yum install php-mysql
yum install mysql-server

Also. chkconfig is ok. ntsysv as a more interactive and visual.

Posted by Morten Bjoernsvik on August 16 2011 9:26am[Delete] [Edit]

(V5.5.15 build from sources opensuse11.4)

I think the support-files/mysql.server needs to be rewritten. It is way to complex for just managing mysqld_safe

The documentation urge You to install as a non root user, but this script does not take --user into account, Even though you add user='mysql_test' to the my.conf file.

In order to start I need the following command:
/opt/mysql/bin/mysqld_safe --user='mysql_test' --datadir='/home/mysqldata' --basedir=/opt/mysql

I have to use
/etc/init.d/mysql.server start --user='mysql_test'
to get it to work. But it will not autostart

I just added a $user variable to the script and pushed it into the $mysql_safe command. then it works.