2 .\" Title: \fBmysqld_safe\fR
3 .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/>
6 .\" Manual: MySQL Database System
10 .TH "\FBMYSQLD_SAFE\FR" "1" "11/04/2013" "MySQL 5\&.1" "MySQL Database System"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 .\" tools: mysqld_safe
34 mysqld_safe \- MySQL server startup script
36 .HP \w'\fBmysqld_safe\ \fR\fB\fIoptions\fR\fR\ 'u
37 \fBmysqld_safe \fR\fB\fIoptions\fR\fR
41 is the recommended way to start a
43 server on Unix and NetWare\&.
45 adds some safety features such as restarting the server when an error occurs and logging runtime information to an error log file\&. Descriptions of error logging and NetWare\-specific behaviors are given later in this section\&.
51 .nr an-no-space-flag 1
59 In MySQL 5\&.1\&.20 (only), the default error logging behavior with
63 on systems that support the
65 program\&. This differs from the default behavior of writing an error log file for other versions\&.
67 \fBIn 5\&.1\&.20, logging to \fR\fBsyslog\fR\fB may fail to operate correctly in some cases; if so, use \fR\fB\fB\-\-skip\-syslog\fR\fR\fB to use the default log file or \fR\fB\fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR\fR\fB to specify a log file name explicitly\&.\fR
72 tries to start an executable named
73 \fBmysqld\fR\&. To override the default behavior and specify explicitly the name of the server you want to run, specify a
76 \fB\-\-mysqld\-version\fR
78 \fBmysqld_safe\fR\&. You can also use
80 to indicate the directory where
82 should look for the server\&.
84 Many of the options to
86 are the same as the options to
88 Section\ \&5.1.3, \(lqServer Command Options\(rq\&.
94 if they are specified on the command line, but ignored if they are specified in the
96 group of an option file\&. See
97 Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&.
100 reads all options from the
104 sections in option files\&. For example, if you specify a
108 will find and use the
117 log\-error=error\&.log
123 For backward compatibility,
127 sections, although you should rename such sections to
129 in MySQL 5\&.1 installations\&.
132 supports the options in the following list\&. It also reads option files and supports the options for processing them described at
133 Section\ \&4.2.3.4, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
143 .\" mysqld_safe: help option
144 .\" help option: mysqld_safe
147 Display a help message and exit\&.
158 .\" mysqld_safe: autoclose option
159 .\" autoclose option: mysqld_safe
162 (NetWare only) On NetWare,
164 provides a screen presence\&. When you unload (shut down) the
166 NLM, the screen does not by default go away\&. Instead, it prompts for user input:
172 *<NLM has terminated; Press any key to close the screen>*
178 If you want NetWare to close the screen automatically instead, use the
192 .\" mysqld_safe: basedir option
193 .\" basedir option: mysqld_safe
194 \fB\-\-basedir=\fR\fB\fIpath\fR\fR
196 The path to the MySQL installation directory\&.
207 .\" mysqld_safe: core-file-size option
208 .\" core-file-size option: mysqld_safe
209 \fB\-\-core\-file\-size=\fR\fB\fIsize\fR\fR
211 The size of the core file that
213 should be able to create\&. The option value is passed to
225 .\" mysqld_safe: datadir option
226 .\" datadir option: mysqld_safe
227 \fB\-\-datadir=\fR\fB\fIpath\fR\fR
229 The path to the data directory\&.
240 .\" mysqld_safe: defaults-extra-file option
241 .\" defaults-extra-file option: mysqld_safe
242 \fB\-\-defaults\-extra\-file=\fR\fB\fIpath\fR\fR
244 The name of an option file to be read in addition to the usual option files\&. This must be the first option on the command line if it is used\&. If the file does not exist or is otherwise inaccessible, the server will exit with an error\&.
255 .\" mysqld_safe: defaults-file option
256 .\" defaults-file option: mysqld_safe
257 \fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
259 The name of an option file to be read instead of the usual option files\&. This must be the first option on the command line if it is used\&.
270 .\" mysqld_safe: ledir option
271 .\" ledir option: mysqld_safe
272 \fB\-\-ledir=\fR\fB\fIpath\fR\fR
276 cannot find the server, use this option to indicate the path name to the directory where the server is located\&.
287 .\" mysqld_safe: log-error option
288 .\" log-error option: mysqld_safe
289 \fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR
291 Write the error log to the given file\&. See
292 Section\ \&5.2.2, \(lqThe Error Log\(rq\&.
303 .\" mysqld_safe: mysqld option
304 .\" mysqld option: mysqld_safe
305 \fB\-\-mysqld=\fR\fB\fIprog_name\fR\fR
307 The name of the server program (in the
309 directory) that you want to start\&. This option is needed if you use the MySQL binary distribution but have the data directory outside of the binary distribution\&. If
311 cannot find the server, use the
313 option to indicate the path name to the directory where the server is located\&.
324 .\" mysqld_safe: mysqld-version option
325 .\" mysqld-version option: mysqld_safe
326 \fB\-\-mysqld\-version=\fR\fB\fIsuffix\fR\fR
328 This option is similar to the
330 option, but you specify only the suffix for the server program name\&. The basename is assumed to be
331 \fBmysqld\fR\&. For example, if you use
332 \fB\-\-mysqld\-version=debug\fR,
338 directory\&. If the argument to
339 \fB\-\-mysqld\-version\fR
357 .\" mysqld_safe: nice option
358 .\" nice option: mysqld_safe
359 \fB\-\-nice=\fR\fB\fIpriority\fR\fR
363 program to set the server\*(Aqs scheduling priority to the given value\&.
374 .\" mysqld_safe: no-defaults option
375 .\" no-defaults option: mysqld_safe
376 \fB\-\-no\-defaults\fR
378 Do not read any option files\&. This must be the first option on the command line if it is used\&.
389 .\" mysqld_safe: open-files-limit option
390 .\" open-files-limit option: mysqld_safe
391 \fB\-\-open\-files\-limit=\fR\fB\fIcount\fR\fR
393 The number of files that
395 should be able to open\&. The option value is passed to
396 \fBulimit \-n\fR\&. Note that you need to start
400 for this to work properly!
411 .\" mysqld_safe: pid-file option
412 .\" pid-file option: mysqld_safe
413 \fB\-\-pid\-file=\fR\fB\fIfile_name\fR\fR
415 The path name of the process ID file\&.
426 .\" mysqld_safe: port option
427 .\" port option: mysqld_safe
428 \fB\-\-port=\fR\fB\fIport_num\fR\fR
430 The port number that the server should use when listening for TCP/IP connections\&. The port number must be 1024 or higher unless the server is started by the
443 .\" mysqld_safe: skip-kill-mysqld option
444 .\" skip-kill-mysqld option: mysqld_safe
445 \fB\-\-skip\-kill\-mysqld\fR
447 Do not try to kill stray
449 processes at startup\&. This option works only on Linux\&.
460 .\" mysqld_safe: socket option
461 .\" socket option: mysqld_safe
462 \fB\-\-socket=\fR\fB\fIpath\fR\fR
464 The Unix socket file that the server should use when listening for local connections\&.
475 .\" mysqld_safe: syslog option
476 .\" syslog option: mysqld_safe
477 .\" mysqld_safe: skip-syslog option
478 .\" skip-syslog option: mysqld_safe
480 \fB\-\-skip\-syslog\fR
483 causes error messages to be sent to
485 on systems that support the
489 suppresses the use of
490 syslog; messages are written to an error log file\&. These options were added in MySQL 5\&.1\&.20\&.
496 syslog priority/facility is used for all log messages\&.
507 .\" mysqld_safe: syslog-tag option
508 .\" syslog-tag option: mysqld_safe
509 \fB\-\-syslog\-tag=\fR\fB\fItag\fR\fR
512 syslog, messages from
516 are written with a tag of
519 mysqld, respectively\&. To specify a suffix for the tag, use
520 \fB\-\-syslog\-tag=\fR\fB\fItag\fR\fR, which modifies the tags to be
521 mysqld_safe\-\fItag\fR
523 mysqld\-\fItag\fR\&. This option was added in MySQL 5\&.1\&.21\&.
534 .\" mysqld_safe: timezone option
535 .\" timezone option: mysqld_safe
536 \fB\-\-timezone=\fR\fB\fItimezone\fR\fR
540 time zone environment variable to the given option value\&. Consult your operating system documentation for legal time zone specification formats\&.
551 .\" mysqld_safe: user option
552 .\" user option: mysqld_safe
553 \fB\-\-user={\fR\fB\fIuser_name\fR\fR\fB|\fR\fB\fIuser_id\fR\fR\fB}\fR
557 server as the user having the name
559 or the numeric user ID
560 \fIuser_id\fR\&. (\(lqUser\(rq
561 in this context refers to a system login account, not a MySQL user listed in the grant tables\&.)
567 \fB\-\-defaults\-file\fR
569 \fB\-\-defaults\-extra\-file\fR
570 option to name an option file, the option must be the first one given on the command line or the option file will not be used\&. For example, this command will not use the named option file:
576 mysql> \fBmysqld_safe \-\-port=\fR\fB\fIport_num\fR\fR\fB \-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
582 Instead, use the following command:
588 mysql> \fBmysqld_safe \-\-defaults\-file=\fR\fB\fIfile_name\fR\fR\fB \-\-port=\fR\fB\fIport_num\fR\fR
596 script is written so that it normally can start a server that was installed from either a source or a binary distribution of MySQL, even though these types of distributions typically install the server in slightly different locations\&. (See
597 Section\ \&2.1.5, \(lqInstallation Layouts\(rq\&.)
599 expects one of the following conditions to be true:
609 The server and databases can be found relative to the working directory (the directory from which
611 is invoked)\&. For binary distributions,
613 looks under its working directory for
617 directories\&. For source distributions, it looks for
621 directories\&. This condition should be met if you execute
623 from your MySQL installation directory (for example,
625 for a binary distribution)\&.
636 If the server and databases cannot be found relative to the working directory,
638 attempts to locate them by absolute path names\&. Typical locations are
641 /usr/local/var\&. The actual locations are determined from the values configured into the distribution at the time it was built\&. They should be correct if MySQL is installed in the location specified at configuration time\&.
646 tries to find the server and databases relative to its own working directory, you can install a binary distribution of MySQL anywhere, as long as you run
648 from the MySQL installation directory:
654 shell> \fBcd \fR\fB\fImysql_installation_directory\fR\fR
655 shell> \fBbin/mysqld_safe &\fR
663 fails, even when invoked from the MySQL installation directory, you can specify the
667 options to indicate the directories in which the server and databases are located on your system\&.
674 arranges for error (and notice) messages from itself and from
676 to go to the same destination\&.
678 As of MySQL 5\&.1\&.20, there are several
680 options for controlling the destination of these messages:
690 \fB\-\-syslog\fR: Write error messages to
692 on systems that support the
705 \fB\-\-skip\-syslog\fR: Do not write error messages to
706 syslog\&. Messages are written to the default error log file (\fIhost_name\fR\&.err
707 in the data directory), or to a named file if the
720 \fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR: Write error messages to the named error file\&.
723 If none of these options is given, the default is
724 \fB\-\-skip\-syslog\fR\&.
730 .nr an-no-space-flag 1
739 \fIonly\fR, the default is
740 \fB\-\-syslog\fR\&. This differs from logging behavior for other versions of MySQL, for which the default is to write messages to the default error log file\&.
748 are both given, a warning is issued and
754 writes a message, notices go to the logging destination (syslog
755 or the error log file) and
756 stdout\&. Errors go to the logging destination and
759 Before MySQL 5\&.1\&.20, error logging is controlled only with the
761 option\&. If it is given, messages go to the named error file\&. Otherwise, messages go to the default error file\&.
763 Normally, you should not edit the
765 script\&. Instead, configure
767 by using command\-line options or options in the
771 option file\&. In rare cases, it might be necessary to edit
773 to get it to start the server properly\&. However, if you do this, your modified version of
775 might be overwritten if you upgrade MySQL in the future, so you should make a copy of your edited version that you can reinstall\&.
779 is a NetWare Loadable Module (NLM) that is ported from the original Unix shell script\&. It starts the server as follows:
789 Runs a number of system and option checks\&.
813 Provides a screen presence for the MySQL server\&.
825 \fBmysqld\fR, monitors it, and restarts it if it terminates in error\&.
836 Sends error messages from
839 \fIhost_name\fR\&.err
840 file in the data directory\&.
854 \fIhost_name\fR\&.safe
855 file in the data directory\&.
860 Copyright \(co 1997, 2013, Oracle and/or its affiliates. All rights reserved.
862 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
864 This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
866 You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
869 For more information, please refer to the MySQL Reference Manual,
870 which may already be installed locally and which is also available
871 online at http://dev.mysql.com/doc/.
873 Oracle Corporation (http://dev.mysql.com/).