2
.\" Title: \fBmysqld_safe\fR
3
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
6
.\" Manual: MySQL Database System
10
.TH "\FBMYSQLD_SAFE\FR" "1" "03/01/2010" "MySQL 5\&.1" "MySQL Database System"
11
.\" -----------------------------------------------------------------
12
.\" * set default formatting
13
.\" -----------------------------------------------------------------
14
.\" disable hyphenation
16
.\" disable justification (adjust text to left margin only)
18
.\" -----------------------------------------------------------------
19
.\" * MAIN CONTENT STARTS HERE *
20
.\" -----------------------------------------------------------------
22
.\" tools: mysqld_safe
25
mysqld_safe \- MySQL server startup script
27
.HP \w'\fBmysqld_safe\ \fR\fB\fIoptions\fR\fR\ 'u
28
\fBmysqld_safe \fR\fB\fIoptions\fR\fR
32
is the recommended way to start a
34
server on Unix and NetWare\&.
36
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\&.
42
.nr an-no-space-flag 1
50
In MySQL 5\&.1\&.20 (only), the default error logging behavior with
54
on systems that support the
56
program\&. This differs from the default behavior of writing an error log file for other versions\&.
58
\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
63
tries to start an executable named
64
\fBmysqld\fR\&. To override the default behavior and specify explicitly the name of the server you want to run, specify a
67
\fB\-\-mysqld\-version\fR
69
\fBmysqld_safe\fR\&. You can also use
71
to indicate the directory where
73
should look for the server\&.
75
Many of the options to
77
are the same as the options to
79
Section\ \&5.1.2, \(lqServer Command Options\(rq\&.
85
if they are specified on the command line, but ignored if they are specified in the
87
group of an option file\&. See
88
Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&.
91
reads all options from the
95
sections in option files\&. For example, if you specify a
108
log\-error=error\&.log
114
For backward compatibility,
118
sections, although you should rename such sections to
120
in MySQL 5\&.1 installations\&.
123
supports the options in the following list\&. It also reads option files and supports the options for processing them described at
124
Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
134
.\" mysqld_safe: help option
135
.\" help option: mysqld_safe
138
Display a help message and exit\&.
149
.\" mysqld_safe: autoclose option
150
.\" autoclose option: mysqld_safe
153
(NetWare only) On NetWare,
155
provides a screen presence\&. When you unload (shut down) the
157
NLM, the screen does not by default go away\&. Instead, it prompts for user input:
163
*<NLM has terminated; Press any key to close the screen>*
169
If you want NetWare to close the screen automatically instead, use the
183
.\" mysqld_safe: basedir option
184
.\" basedir option: mysqld_safe
185
\fB\-\-basedir=\fR\fB\fIpath\fR\fR
187
The path to the MySQL installation directory\&.
198
.\" mysqld_safe: core-file-size option
199
.\" core-file-size option: mysqld_safe
200
\fB\-\-core\-file\-size=\fR\fB\fIsize\fR\fR
202
The size of the core file that
204
should be able to create\&. The option value is passed to
216
.\" mysqld_safe: datadir option
217
.\" datadir option: mysqld_safe
218
\fB\-\-datadir=\fR\fB\fIpath\fR\fR
220
The path to the data directory\&.
231
.\" mysqld_safe: defaults-extra-file option
232
.\" defaults-extra-file option: mysqld_safe
233
\fB\-\-defaults\-extra\-file=\fR\fB\fIpath\fR\fR
235
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\&.
246
.\" mysqld_safe: defaults-file option
247
.\" defaults-file option: mysqld_safe
248
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
250
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\&.
261
.\" mysqld_safe: ledir option
262
.\" ledir option: mysqld_safe
263
\fB\-\-ledir=\fR\fB\fIpath\fR\fR
267
cannot find the server, use this option to indicate the path name to the directory where the server is located\&.
278
.\" mysqld_safe: log-error option
279
.\" log-error option: mysqld_safe
280
\fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR
282
Write the error log to the given file\&. See
283
Section\ \&5.2.2, \(lqThe Error Log\(rq\&.
294
.\" mysqld_safe: mysqld option
295
.\" mysqld option: mysqld_safe
296
\fB\-\-mysqld=\fR\fB\fIprog_name\fR\fR
298
The name of the server program (in the
300
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
302
cannot find the server, use the
304
option to indicate the path name to the directory where the server is located\&.
315
.\" mysqld_safe: mysqld-version option
316
.\" mysqld-version option: mysqld_safe
317
\fB\-\-mysqld\-version=\fR\fB\fIsuffix\fR\fR
319
This option is similar to the
321
option, but you specify only the suffix for the server program name\&. The basename is assumed to be
322
\fBmysqld\fR\&. For example, if you use
323
\fB\-\-mysqld\-version=debug\fR,
329
directory\&. If the argument to
330
\fB\-\-mysqld\-version\fR
348
.\" mysqld_safe: nice option
349
.\" nice option: mysqld_safe
350
\fB\-\-nice=\fR\fB\fIpriority\fR\fR
354
program to set the server\'s scheduling priority to the given value\&.
365
.\" mysqld_safe: no-defaults option
366
.\" no-defaults option: mysqld_safe
367
\fB\-\-no\-defaults\fR
369
Do not read any option files\&. This must be the first option on the command line if it is used\&.
380
.\" mysqld_safe: open-files-limit option
381
.\" open-files-limit option: mysqld_safe
382
\fB\-\-open\-files\-limit=\fR\fB\fIcount\fR\fR
384
The number of files that
386
should be able to open\&. The option value is passed to
387
\fBulimit \-n\fR\&. Note that you need to start
391
for this to work properly!
402
.\" mysqld_safe: pid-file option
403
.\" pid-file option: mysqld_safe
404
\fB\-\-pid\-file=\fR\fB\fIfile_name\fR\fR
406
The path name of the process ID file\&.
417
.\" mysqld_safe: port option
418
.\" port option: mysqld_safe
419
\fB\-\-port=\fR\fB\fIport_num\fR\fR
421
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
434
.\" mysqld_safe: skip-kill-mysqld option
435
.\" skip-kill-mysqld option: mysqld_safe
436
\fB\-\-skip\-kill\-mysqld\fR
438
Do not try to kill stray
440
processes at startup\&. This option works only on Linux\&.
451
.\" mysqld_safe: socket option
452
.\" socket option: mysqld_safe
453
\fB\-\-socket=\fR\fB\fIpath\fR\fR
455
The Unix socket file that the server should use when listening for local connections\&.
466
.\" mysqld_safe: syslog option
467
.\" syslog option: mysqld_safe
468
.\" mysqld_safe: skip-syslog option
469
.\" skip-syslog option: mysqld_safe
471
\fB\-\-skip\-syslog\fR
474
causes error messages to be sent to
476
on systems that support the
480
suppresses the use of
481
syslog; messages are written to an error log file\&. These options were added in MySQL 5\&.1\&.20\&.
492
.\" mysqld_safe: syslog-tag option
493
.\" syslog-tag option: mysqld_safe
494
\fB\-\-syslog\-tag=\fR\fB\fItag\fR\fR
497
syslog, messages from
501
are written with a tag of
504
mysqld, respectively\&. To specify a suffix for the tag, use
505
\fB\-\-syslog\-tag=\fR\fB\fItag\fR\fR, which modifies the tags to be
506
mysqld_safe\-\fItag\fR
508
mysqld\-\fItag\fR\&. This option was added in MySQL 5\&.1\&.21\&.
519
.\" mysqld_safe: timezone option
520
.\" timezone option: mysqld_safe
521
\fB\-\-timezone=\fR\fB\fItimezone\fR\fR
525
time zone environment variable to the given option value\&. Consult your operating system documentation for legal time zone specification formats\&.
536
.\" mysqld_safe: user option
537
.\" user option: mysqld_safe
538
\fB\-\-user={\fR\fB\fIuser_name\fR\fR\fB|\fR\fB\fIuser_id\fR\fR\fB}\fR
542
server as the user having the name
544
or the numeric user ID
545
\fIuser_id\fR\&. (\(lqUser\(rq
546
in this context refers to a system login account, not a MySQL user listed in the grant tables\&.)
552
\fB\-\-defaults\-file\fR
554
\fB\-\-defaults\-extra\-file\fR
555
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:
561
mysql> \fBmysqld_safe \-\-port=\fR\fB\fIport_num\fR\fR\fB \-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
567
Instead, use the following command:
573
mysql> \fBmysqld_safe \-\-defaults\-file=\fR\fB\fIfile_name\fR\fR\fB \-\-port=\fR\fB\fIport_num\fR\fR
581
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
582
Section\ \&2.1.5, \(lqInstallation Layouts\(rq\&.)
584
expects one of the following conditions to be true:
594
The server and databases can be found relative to the working directory (the directory from which
596
is invoked)\&. For binary distributions,
598
looks under its working directory for
602
directories\&. For source distributions, it looks for
606
directories\&. This condition should be met if you execute
608
from your MySQL installation directory (for example,
610
for a binary distribution)\&.
621
If the server and databases cannot be found relative to the working directory,
623
attempts to locate them by absolute path names\&. Typical locations are
626
/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\&.
631
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
633
from the MySQL installation directory:
639
shell> \fBcd \fR\fB\fImysql_installation_directory\fR\fR
640
shell> \fBbin/mysqld_safe &\fR
648
fails, even when invoked from the MySQL installation directory, you can specify the
652
options to indicate the directories in which the server and databases are located on your system\&.
659
arranges for error (and notice) messages from itself and from
661
to go to the same destination\&.
663
As of MySQL 5\&.1\&.20, there are several
665
options for controlling the destination of these messages:
675
\fB\-\-syslog\fR: Write error messages to
677
on systems that support the
690
\fB\-\-skip\-syslog\fR: Do not write error messages to
691
syslog\&. Messages are written to the default error log file (\fIhost_name\fR\&.err
692
in the data directory), or to a named file if the
705
\fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR: Write error messages to the named error file\&.
708
If none of these options is given, the default is
709
\fB\-\-skip\-syslog\fR\&.
715
.nr an-no-space-flag 1
724
\fIonly\fR, the default is
725
\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\&.
733
are both given, a warning is issued and
739
writes a message, notices go to the logging destination (syslog
740
or the error log file) and
741
stdout\&. Errors go to the logging destination and
744
Before MySQL 5\&.1\&.20, error logging is controlled only with the
746
option\&. If it is given, messages go to the named error file\&. Otherwise, messages go to the default error file\&.
748
Normally, you should not edit the
750
script\&. Instead, configure
752
by using command\-line options or options in the
756
option file\&. In rare cases, it might be necessary to edit
758
to get it to start the server properly\&. However, if you do this, your modified version of
760
might be overwritten if you upgrade MySQL in the future, so you should make a copy of your edited version that you can reinstall\&.
764
is a NetWare Loadable Module (NLM) that is ported from the original Unix shell script\&. It starts the server as follows:
774
Runs a number of system and option checks\&.
798
Provides a screen presence for the MySQL server\&.
810
\fBmysqld\fR, monitors it, and restarts it if it terminates in error\&.
821
Sends error messages from
824
\fIhost_name\fR\&.err
825
file in the data directory\&.
839
\fIhost_name\fR\&.safe
840
file in the data directory\&.
845
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
847
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.
849
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.
851
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/.
854
For more information, please refer to the MySQL Reference Manual,
855
which may already be installed locally and which is also available
856
online at http://dev.mysql.com/doc/.
858
Sun Microsystems, Inc. (http://www.mysql.com/).