1
.\" Title: \fBmysqld_safe\fR
3
.\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
5
.\" Manual: MySQL Database System
8
.TH "\fBMYSQLD_SAFE\fR" "1" "01/09/2007" "MySQL 5.0" "MySQL Database System"
9
.\" disable hyphenation
11
.\" disable justification (adjust text to left margin only)
14
mysqld_safe \- MySQL server startup script
16
safe_mysqld \- MySQL server startup script
19
\fBmysqld_safe \fR\fB\fIoptions\fR\fR
23
is the recommended way to start a
25
server on Unix and NetWare.
27
adds some safety features such as restarting the server when an error occurs and logging runtime information to an error log file. NetWare\-specific behaviors are listed later in this section.
29
\fBNote\fR: To preserve backward compatibility with older versions of MySQL, MySQL binary distributions still include
32
\fBmysqld_safe\fR. However, you should not rely on this because it is removed as of MySQL 5.1.
36
tries to start an executable named
40
otherwise. Be aware of the implications of this behavior:
47
behavior. The RPM installs an executable named
48
\fBmysqld\-max\fR, which causes
50
to automatically use that executable rather than
55
If you install a MySQL\-Max distribution that includes a server named
56
\fBmysqld\-max\fR, and then upgrade later to a non\-Max version of MySQL,
58
will still attempt to run the old
60
server. If you perform such an upgrade, you should manually remove the old
70
To override the default behavior and specify explicitly the name of the server you want to run, specify a
73
\fB\-\-mysqld\-version\fR
75
\fBmysqld_safe\fR. You can also use
77
to indicate the directory where
79
should look for the server.
81
Many of the options to
83
are the same as the options to
85
the section called \(lqCOMMAND OPTIONS\(rq.
87
All options specified to
89
on the command line are passed to
90
\fBmysqld\fR. If you want to use any options that are specific to
94
doesn't support, do not specify them on the command line. Instead, list them in the
96
group of an option file. See
97
Section\ 3.2, \(lqUsing Option Files\(rq.
100
reads all options from the
104
sections in option files. For backward compatibility, it also reads
106
sections, although you should rename such sections to
108
in MySQL 5.0 installations.
111
supports the following options:
116
Display a help message and exit. (Added in MySQL 5.0.3)
121
(NetWare only) On NetWare,
123
provides a screen presence. When you unload (shut down) the
125
NLM, the screen does not by default go away. Instead, it prompts for user input:
129
*<NLM has terminated; Press any key to close the screen>*
132
If you want NetWare to close the screen automatically instead, use the
138
\fB\-\-basedir=\fR\fB\fIpath\fR\fR
140
The path to the MySQL installation directory.
143
\fB\-\-core\-file\-size=\fR\fB\fIsize\fR\fR
145
The size of the core file that
147
should be able to create. The option value is passed to
151
\fB\-\-datadir=\fR\fB\fIpath\fR\fR
153
The path to the data directory.
156
\fB\-\-defaults\-extra\-file=\fR\fB\fIpath\fR\fR
158
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. As of MySQL 5.0.6, if the file does not exist or is otherwise inaccessible, the server will exit with an error.
161
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
163
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.
166
\fB\-\-ledir=\fR\fB\fIpath\fR\fR
170
cannot find the server, use this option to indicate the pathname to the directory where the server is located.
173
\fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR
175
Write the error log to the given file. See
176
Section\ 10.1, \(lqThe Error Log\(rq.
179
\fB\-\-mysqld=\fR\fB\fIprog_name\fR\fR
181
The name of the server program (in the
183
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
185
cannot find the server, use the
187
option to indicate the pathname to the directory where the server is located.
190
\fB\-\-mysqld\-version=\fR\fB\fIsuffix\fR\fR
192
This option is similar to the
194
option, but you specify only the suffix for the server program name. The basename is assumed to be
195
\fBmysqld\fR. For example, if you use
196
\fB\-\-mysqld\-version=max\fR,
202
directory. If the argument to
203
\fB\-\-mysqld\-version\fR
213
\fB\-\-nice=\fR\fB\fIpriority\fR\fR
217
program to set the server's scheduling priority to the given value.
220
\fB\-\-no\-defaults\fR
222
Do not read any option files. This must be the first option on the command line if it is used.
225
\fB\-\-open\-files\-limit=\fR\fB\fIcount\fR\fR
227
The number of files that
229
should be able to open. The option value is passed to
230
\fBulimit \-n\fR. Note that you need to start
234
for this to work properly!
237
\fB\-\-pid\-file=\fR\fB\fIfile_name\fR\fR
239
The pathname of the process ID file.
242
\fB\-\-port=\fR\fB\fIport_num\fR\fR
244
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
249
\fB\-\-socket=\fR\fB\fIpath\fR\fR
251
The Unix socket file that the server should use when listening for local connections.
254
\fB\-\-timezone=\fR\fB\fItimezone\fR\fR
258
time zone environment variable to the given option value. Consult your operating system documentation for legal time zone specification formats.
261
\fB\-\-user={\fR\fB\fIuser_name\fR\fR\fB|\fR\fB\fIuser_id\fR\fR\fB}\fR
265
server as the user having the name
267
or the numeric user ID
268
\fIuser_id\fR. (\(lqUser\(rq
269
in this context refers to a system login account, not a MySQL user listed in the grant tables.)
276
\fB\-\-defaults\-file\fR
278
\fB\-\-defaults\-extra\-option\fR
279
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:
283
mysql> \fBmysqld_safe \-\-port=\fR\fB\fIport_num\fR\fR\fB \-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
287
Instead, use the following command:
291
mysql> \fBmysqld_safe \-\-defaults\-file=\fR\fB\fIfile_name\fR\fR\fB \-\-port=\fR\fB\fIport_num\fR\fR
297
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
298
Section\ 4.6, \(lqInstallation Layouts\(rq.)
300
expects one of the following conditions to be true:
303
The server and databases can be found relative to the working directory (the directory from which
305
is invoked). For binary distributions,
307
looks under its working directory for
311
directories. For source distributions, it looks for
315
directories. This condition should be met if you execute
317
from your MySQL installation directory (for example,
318
\fI/usr/local/mysql\fR
319
for a binary distribution).
322
If the server and databases cannot be found relative to the working directory,
324
attempts to locate them by absolute pathnames. Typical locations are
325
\fI/usr/local/libexec\fR
327
\fI/usr/local/var\fR. 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.
333
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
335
from the MySQL installation directory:
339
shell> \fBcd \fR\fB\fImysql_installation_directory\fR\fR
340
shell> \fBbin/mysqld_safe &\fR
346
fails, even when invoked from the MySQL installation directory, you can specify the
350
options to indicate the directories in which the server and databases are located on your system.
352
Normally, you should not edit the
354
script. Instead, configure
356
by using command\-line options or options in the
360
option file. In rare cases, it might be necessary to edit
362
to get it to start the server properly. However, if you do this, your modified version of
364
might be overwritten if you upgrade MySQL in the future, so you should make a copy of your edited version that you can reinstall.
368
is a NetWare Loadable Module (NLM) that is ported from the original Unix shell script. It starts the server as follows:
371
Runs a number of system and option checks.
379
Provides a screen presence for the MySQL server.
383
\fBmysqld\fR, monitors it, and restarts it if it terminates in error.
386
Sends error messages from
389
\fI\fIhost_name\fR\fR\fI.err\fR
390
file in the data directory.
396
\fI\fIhost_name\fR\fR\fI.safe\fR
397
file in the data directory.
400
Copyright 1997\-2006 MySQL AB
402
This documentation is NOT distributed under a GPL license. Use of this documentation is subject to the following terms: You may create a printed copy of this documentation solely for your own personal use. Conversion to other formats is allowed as long as the actual content is not altered or edited in any way. You shall not publish or distribute this documentation in any form or on any media, except if you distribute the documentation in a manner similar to how MySQL disseminates it (that is, electronically for download on a Web site with the software) or on a CD\-ROM or similar medium, provided however that the documentation is disseminated together with the software on the same medium. Any other use, such as any dissemination of printed copies or use of this documentation, in whole or in part, in another publication, requires the prior written consent from an authorized representative of MySQL AB. MySQL AB reserves any and all rights to this documentation not expressly granted above.
406
for more information.
409
my_print_defaults(1),
417
mysql_explain_log(1),
418
mysql_fix_privilege_tables(1),
419
mysql_tzinfo_to_sql(1),
437
For more information, please refer to the MySQL Reference Manual,
438
which may already be installed locally and which is also available
439
online at http://dev.mysql.com/doc/.
441
MySQL AB (http://www.mysql.com/).
442
This software comes with no warranty.