mysqld_safe
mysqld_safe [options]mysqld_safe is recommended utility for starting the MySQL server
because the server is restarted automatically if it dies unexpectedly.
The utility is available on Unix and Novell NetWare systems.
Although options may be entered from the command line, they
should be included in the options file (e.g.,
my.cnf) under the heading
[mysqld_safe]. Options specific to
mysqld_safe should not be passed on the command
line because they will be passed to the mysqld
server, which will try to interpret them. Therefore, options are shown
here as they would appear in the configuration file, without initial
hyphens. mysqld_safe can also accept options for
the mysqld server, but the configuration file is
also better for these because it ensures they will be passed to the
daemon when it’s reloaded after a crash:
autocloseOn Novell NetWare systems, when
mysqld_safe closes, the related screen does
not close automatically without user interaction. Use this
option to have the screen close automatically.
basedir=pathThis option is necessary and is used to specify the path to the directory where MySQL files are installed.
core-file-size=valueThis option sets the maximum size set for the core file to create if the daemon dies.
datadir=pathThis option specifies the directory that contains datafiles (i.e., table files).
defaults-extra-file=filenameThis option specifies an additional options file to use
after the default file is read. When used at the command line,
this has to be the first option, except that --defaults-file must precede it
if used.
defaults-file=filenameThis option specifies the default options file for the server; it can be used to substitute special options for the normal default options files. When used at the command line, this has to be the first option given.
err-log=filenameThis option specifies the path to the error log for error messages outside the daemon, such as errors when starting.
ledir=pathThis option is necessary for running
mysqld_safe. It specifies the path where the
daemons may be found.
log-error[=filename]This option enables logging of error messages and server
startup messages, optionally specifying a log file. The default
log file is
host.err in
MySQL’s data directory, where host is
the host’s name.
mysqld=daemonThis option is required when using a binary distribution
and the data directory for MySQL is not in the location
originally set by the distribution. With it you specify which
daemon to start (i.e., mysqld). This daemon
program must be in the same directory given with the
ledir option.
mysqld-version=[max]This option specifies which daemon to use by providing the
suffix of the daemon’s name. A value of max
starts mysqld-max, whereas a blank value
ensures mysqld is started.
nice=numberThis option employs the nice utility to
give scheduling priority to the value given.
no-defaultsThis option instructs the script not to refer to configuration files for options. When used at the command line, this has to be the first option given.
open-files-limit=numberThis option limits the number of files the daemon may open. Only root may use this option.
pid-file=filenameThis option specifies the file that will store the server’s process identifier.
port=portThis option specifies the TCP/IP port number to which
mysqld_safe should listen for incoming
connections. Unless started by the root
filesystem user, the port number should be 1024 or
higher.
skip-kill-mysqldWhen mysqld_safe is started on a Linux
system, if this option is not used, any
mysqld processes that are running will be
terminated by it. Use this option to allow existing servers to
stay up.
skip-syslogThis option causes the daemon not to log errors to the
system’s syslog facility. The MySQL-specific
log will still be written. This option is available as of
version 5.1.20 of MySQL. See syslog below for
more information related to this option.
socket=filenameThis option provides the name of the server’s socket file for local connections.
syslogOn operating systems that support the
logger program, this option instructs the
daemon to log error messages to the related
syslog. This option is available as of
version 5.1.20 of MySQL. See skip-syslog
above for more information related to this option.
syslog-tagWhen writing error messages to syslog,
this option marks each message with mysqld or
mysqld_safe, depending on the source of the
error. This option is available as of version 5.1.21 of MySQL.
See syslog and skip-syslog
previously for more information related to this option.
timezone=zoneThis option sets the environment variable
TZ for the timezone of the server.
user=userThis option specifies the username or user ID number for the user that starts the server.