'mysqld_safe'

mysqld_safe is a shell script that starts up the mysqld server and monitors it. If the server dies, mysqld_safe restarts it. Prior to MySQL 4, mysqld_safe was known as safe_mysqld.

mysqld_safe is a shell script and is unavailable on Windows.

Usage

mysqld_safe [options] 

Options Specific to mysld_safe

Options that can be used with mysqld can also be used with mysqld_safe, which simply passes them to mysqld. In addition, mysqld_safe understands the following options of its own:

  • --core-file-size=n

    Limit the size of core files to n bytes if the server crashes. This option was introduced in MySQL 3.23.28.

  • --err-log=file_name

    Use this file for the error log. Relative names are interpreted with respect to the directory from which mysqld_safe was invoked. If this option is not specified, the default error log is HOSTNAME.err in the data directory, where HOSTNAME is the name of the current host. This option was introduced in MySQL 3.23.22.

  • --ledir=dir_name

    Look for the server in this directory. (It's taken to be the location of the "libexec" directory.) This option was introduced in MySQL 3.23.22.

  • --open-files-limit=n

    Set the number of available open file descriptors to n. This option was introduced in MySQL 3.23.41.

  • --mysqld=file_name

    Use file_name as the path to the mysqld program. This option was introduced in MySQL 3.23.30.

  • --timezone=tzspec

    Set the timezone to tzspec. This can be useful if the server doesn't determine the system timezone automatically. This option was introduced in MySQL 3.23.28.

Upgrading Tips

If you're upgrading to MySQL 4.x from MySQL 3.x, when mysqld_safe was known as safe_mysqld, watch out for the following things:

  • Any startup scripts that invoke safe_mysqld should be modified to invoke mysqld_safe. The mysql.server script is one example. However, if you replace your older version with a 4.x version, that will update it automatically to invoke mysqld_safe. If you're using your own startup scripts, make the necessary adjustments.

  • [safe_mysqld] groups in option files should be renamed to [mysqld_safe].