variant of the MySQL server that includes some more cutting-edge (and less commonly used) features. It also turns on server error logging, which you’d otherwise need to specify as an option to mysqld
, and automatically restarts the server if it crashes. Prior to MySQL version 4, this was called safe_mysqld
. On
a Linux or OS X installation, you will still find a symbolic link called safe_mysqld pointing to mysqld_safe
MySQL Server OptionsThe MySQL server is a complex piece of software and has many settings that you can tweak to make it better fit your needs. We’ll discuss some of the more useful server options here. mysqld_safe accepts a number of options of its own and passes on any options it doesn’t handle to mysqld
. The options specific to mysqld_safe are probably not of interest to most readers of this book you can find these by typing mysqld_safe -help at the command line:
basedir
This tells mysqld where MySQL is installed on the system. If you don’t
specify this option, the program will try to use the location specified when the program was compiled.
datadir
This tells mysqld where the database files are stored.
defaults-file
This specifies the location of the options file to read this is particularly useful if you want the server to read in options from a nondefault location.
enable-named-pipe
Allows a server running under Windows to use a named pipe. See skip-networking for more information.
init-file
This specifies a text file containing SQL commands that the server must execute when starting up. This is commonly used to reset a forgotten MySQL root password as discussed in Resetting Forgotten MySQL Passwords in Chapter 9.
log
This tells mysqld to use the specified file to log every client connection and query.
log-bin
This specifies where you want the binary log of commands that attempt to modify data on the server.
log-error
This tells mysqld to use the specified file to log server startup, shutdown, and errors.
By default,
this is the file .err in the data directory. For example, the log might show that we’ve run out of disk space:
Share with your friends: