~vlad-lesin/percona-server/mysql-5.0.33-original

« back to all changes in this revision

Viewing changes to man/mysqld_safe.1

  • Committer: Vlad Lesin
  • Date: 2012-07-31 09:21:34 UTC
  • Revision ID: vladislav.lesin@percona.com-20120731092134-zfodx022b7992wsi
VirginĀ 5.0.33

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.\"     Title: \fBmysqld_safe\fR
 
2
.\"    Author: 
 
3
.\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
 
4
.\"      Date: 01/09/2007
 
5
.\"    Manual: MySQL Database System
 
6
.\"    Source: MySQL 5.0
 
7
.\"
 
8
.TH "\fBMYSQLD_SAFE\fR" "1" "01/09/2007" "MySQL 5.0" "MySQL Database System"
 
9
.\" disable hyphenation
 
10
.nh
 
11
.\" disable justification (adjust text to left margin only)
 
12
.ad l
 
13
.SH "NAME"
 
14
mysqld_safe \- MySQL server startup script
 
15
.br
 
16
safe_mysqld \- MySQL server startup script
 
17
.SH "SYNOPSIS"
 
18
.HP 20
 
19
\fBmysqld_safe \fR\fB\fIoptions\fR\fR
 
20
.SH "DESCRIPTION"
 
21
.PP
 
22
\fBmysqld_safe\fR
 
23
is the recommended way to start a
 
24
\fBmysqld\fR
 
25
server on Unix and NetWare.
 
26
\fBmysqld_safe\fR
 
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.
 
28
.PP
 
29
\fBNote\fR: To preserve backward compatibility with older versions of MySQL, MySQL binary distributions still include
 
30
\fBsafe_mysqld\fR
 
31
as a symbolic link to
 
32
\fBmysqld_safe\fR. However, you should not rely on this because it is removed as of MySQL 5.1.
 
33
.PP
 
34
By default,
 
35
\fBmysqld_safe\fR
 
36
tries to start an executable named
 
37
\fBmysqld\-max\fR
 
38
if it exists, and
 
39
\fBmysqld\fR
 
40
otherwise. Be aware of the implications of this behavior:
 
41
.TP 3n
 
42
\(bu
 
43
On Linux, the
 
44
MySQL\-Max
 
45
RPM relies on this
 
46
\fBmysqld_safe\fR
 
47
behavior. The RPM installs an executable named
 
48
\fBmysqld\-max\fR, which causes
 
49
\fBmysqld_safe\fR
 
50
to automatically use that executable rather than
 
51
\fBmysqld\fR
 
52
from that point on.
 
53
.TP 3n
 
54
\(bu
 
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,
 
57
\fBmysqld_safe\fR
 
58
will still attempt to run the old
 
59
\fBmysqld\-max\fR
 
60
server. If you perform such an upgrade, you should manually remove the old
 
61
\fBmysqld\-max\fR
 
62
server to ensure that
 
63
\fBmysqld_safe\fR
 
64
runs the new
 
65
\fBmysqld\fR
 
66
server.
 
67
.sp
 
68
.RE
 
69
.PP
 
70
To override the default behavior and specify explicitly the name of the server you want to run, specify a
 
71
\fB\-\-mysqld\fR
 
72
or
 
73
\fB\-\-mysqld\-version\fR
 
74
option to
 
75
\fBmysqld_safe\fR. You can also use
 
76
\fB\-\-ledir\fR
 
77
to indicate the directory where
 
78
\fBmysqld_safe\fR
 
79
should look for the server.
 
80
.PP
 
81
Many of the options to
 
82
\fBmysqld_safe\fR
 
83
are the same as the options to
 
84
\fBmysqld\fR. See
 
85
the section called \(lqCOMMAND OPTIONS\(rq.
 
86
.PP
 
87
All options specified to
 
88
\fBmysqld_safe\fR
 
89
on the command line are passed to
 
90
\fBmysqld\fR. If you want to use any options that are specific to
 
91
\fBmysqld_safe\fR
 
92
and that
 
93
\fBmysqld\fR
 
94
doesn't support, do not specify them on the command line. Instead, list them in the
 
95
[mysqld_safe]
 
96
group of an option file. See
 
97
Section\ 3.2, \(lqUsing Option Files\(rq.
 
98
.PP
 
99
\fBmysqld_safe\fR
 
100
reads all options from the
 
101
[mysqld],
 
102
[server], and
 
103
[mysqld_safe]
 
104
sections in option files. For backward compatibility, it also reads
 
105
[safe_mysqld]
 
106
sections, although you should rename such sections to
 
107
[mysqld_safe]
 
108
in MySQL 5.0 installations.
 
109
.PP
 
110
\fBmysqld_safe\fR
 
111
supports the following options:
 
112
.TP 3n
 
113
\(bu
 
114
\fB\-\-help\fR
 
115
.sp
 
116
Display a help message and exit. (Added in MySQL 5.0.3)
 
117
.TP 3n
 
118
\(bu
 
119
\fB\-\-autoclose\fR
 
120
.sp
 
121
(NetWare only) On NetWare,
 
122
\fBmysqld_safe\fR
 
123
provides a screen presence. When you unload (shut down) the
 
124
\fBmysqld_safe\fR
 
125
NLM, the screen does not by default go away. Instead, it prompts for user input:
 
126
.sp
 
127
.RS 3n
 
128
.nf
 
129
*<NLM has terminated; Press any key to close the screen>*
 
130
.fi
 
131
.RE
 
132
If you want NetWare to close the screen automatically instead, use the
 
133
\fB\-\-autoclose\fR
 
134
option to
 
135
\fBmysqld_safe\fR.
 
136
.TP 3n
 
137
\(bu
 
138
\fB\-\-basedir=\fR\fB\fIpath\fR\fR
 
139
.sp
 
140
The path to the MySQL installation directory.
 
141
.TP 3n
 
142
\(bu
 
143
\fB\-\-core\-file\-size=\fR\fB\fIsize\fR\fR
 
144
.sp
 
145
The size of the core file that
 
146
\fBmysqld\fR
 
147
should be able to create. The option value is passed to
 
148
\fBulimit \-c\fR.
 
149
.TP 3n
 
150
\(bu
 
151
\fB\-\-datadir=\fR\fB\fIpath\fR\fR
 
152
.sp
 
153
The path to the data directory.
 
154
.TP 3n
 
155
\(bu
 
156
\fB\-\-defaults\-extra\-file=\fR\fB\fIpath\fR\fR
 
157
.sp
 
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.
 
159
.TP 3n
 
160
\(bu
 
161
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
 
162
.sp
 
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.
 
164
.TP 3n
 
165
\(bu
 
166
\fB\-\-ledir=\fR\fB\fIpath\fR\fR
 
167
.sp
 
168
If
 
169
\fBmysqld_safe\fR
 
170
cannot find the server, use this option to indicate the pathname to the directory where the server is located.
 
171
.TP 3n
 
172
\(bu
 
173
\fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR
 
174
.sp
 
175
Write the error log to the given file. See
 
176
Section\ 10.1, \(lqThe Error Log\(rq.
 
177
.TP 3n
 
178
\(bu
 
179
\fB\-\-mysqld=\fR\fB\fIprog_name\fR\fR
 
180
.sp
 
181
The name of the server program (in the
 
182
ledir
 
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
 
184
\fBmysqld_safe\fR
 
185
cannot find the server, use the
 
186
\fB\-\-ledir\fR
 
187
option to indicate the pathname to the directory where the server is located.
 
188
.TP 3n
 
189
\(bu
 
190
\fB\-\-mysqld\-version=\fR\fB\fIsuffix\fR\fR
 
191
.sp
 
192
This option is similar to the
 
193
\fB\-\-mysqld\fR
 
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,
 
197
\fBmysqld_safe\fR
 
198
starts the
 
199
\fBmysqld\-max\fR
 
200
program in the
 
201
ledir
 
202
directory. If the argument to
 
203
\fB\-\-mysqld\-version\fR
 
204
is empty,
 
205
\fBmysqld_safe\fR
 
206
uses
 
207
\fBmysqld\fR
 
208
in the
 
209
ledir
 
210
directory.
 
211
.TP 3n
 
212
\(bu
 
213
\fB\-\-nice=\fR\fB\fIpriority\fR\fR
 
214
.sp
 
215
Use the
 
216
nice
 
217
program to set the server's scheduling priority to the given value.
 
218
.TP 3n
 
219
\(bu
 
220
\fB\-\-no\-defaults\fR
 
221
.sp
 
222
Do not read any option files. This must be the first option on the command line if it is used.
 
223
.TP 3n
 
224
\(bu
 
225
\fB\-\-open\-files\-limit=\fR\fB\fIcount\fR\fR
 
226
.sp
 
227
The number of files that
 
228
\fBmysqld\fR
 
229
should be able to open. The option value is passed to
 
230
\fBulimit \-n\fR. Note that you need to start
 
231
\fBmysqld_safe\fR
 
232
as
 
233
root
 
234
for this to work properly!
 
235
.TP 3n
 
236
\(bu
 
237
\fB\-\-pid\-file=\fR\fB\fIfile_name\fR\fR
 
238
.sp
 
239
The pathname of the process ID file.
 
240
.TP 3n
 
241
\(bu
 
242
\fB\-\-port=\fR\fB\fIport_num\fR\fR
 
243
.sp
 
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
 
245
root
 
246
system user.
 
247
.TP 3n
 
248
\(bu
 
249
\fB\-\-socket=\fR\fB\fIpath\fR\fR
 
250
.sp
 
251
The Unix socket file that the server should use when listening for local connections.
 
252
.TP 3n
 
253
\(bu
 
254
\fB\-\-timezone=\fR\fB\fItimezone\fR\fR
 
255
.sp
 
256
Set the
 
257
TZ
 
258
time zone environment variable to the given option value. Consult your operating system documentation for legal time zone specification formats.
 
259
.TP 3n
 
260
\(bu
 
261
\fB\-\-user={\fR\fB\fIuser_name\fR\fR\fB|\fR\fB\fIuser_id\fR\fR\fB}\fR
 
262
.sp
 
263
Run the
 
264
\fBmysqld\fR
 
265
server as the user having the name
 
266
\fIuser_name\fR
 
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.)
 
270
.sp
 
271
.RE
 
272
.PP
 
273
If you execute
 
274
\fBmysqld_safe\fR
 
275
with the
 
276
\fB\-\-defaults\-file\fR
 
277
or
 
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:
 
280
.sp
 
281
.RS 3n
 
282
.nf
 
283
mysql> \fBmysqld_safe \-\-port=\fR\fB\fIport_num\fR\fR\fB \-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
 
284
.fi
 
285
.RE
 
286
.PP
 
287
Instead, use the following command:
 
288
.sp
 
289
.RS 3n
 
290
.nf
 
291
mysql> \fBmysqld_safe \-\-defaults\-file=\fR\fB\fIfile_name\fR\fR\fB \-\-port=\fR\fB\fIport_num\fR\fR
 
292
.fi
 
293
.RE
 
294
.PP
 
295
The
 
296
\fBmysqld_safe\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.)
 
299
\fBmysqld_safe\fR
 
300
expects one of the following conditions to be true:
 
301
.TP 3n
 
302
\(bu
 
303
The server and databases can be found relative to the working directory (the directory from which
 
304
\fBmysqld_safe\fR
 
305
is invoked). For binary distributions,
 
306
\fBmysqld_safe\fR
 
307
looks under its working directory for
 
308
\fIbin\fR
 
309
and
 
310
\fIdata\fR
 
311
directories. For source distributions, it looks for
 
312
\fIlibexec\fR
 
313
and
 
314
\fIvar\fR
 
315
directories. This condition should be met if you execute
 
316
\fBmysqld_safe\fR
 
317
from your MySQL installation directory (for example,
 
318
\fI/usr/local/mysql\fR
 
319
for a binary distribution).
 
320
.TP 3n
 
321
\(bu
 
322
If the server and databases cannot be found relative to the working directory,
 
323
\fBmysqld_safe\fR
 
324
attempts to locate them by absolute pathnames. Typical locations are
 
325
\fI/usr/local/libexec\fR
 
326
and
 
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.
 
328
.sp
 
329
.RE
 
330
.PP
 
331
Because
 
332
\fBmysqld_safe\fR
 
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
 
334
\fBmysqld_safe\fR
 
335
from the MySQL installation directory:
 
336
.sp
 
337
.RS 3n
 
338
.nf
 
339
shell> \fBcd \fR\fB\fImysql_installation_directory\fR\fR
 
340
shell> \fBbin/mysqld_safe &\fR
 
341
.fi
 
342
.RE
 
343
.PP
 
344
If
 
345
\fBmysqld_safe\fR
 
346
fails, even when invoked from the MySQL installation directory, you can specify the
 
347
\fB\-\-ledir\fR
 
348
and
 
349
\fB\-\-datadir\fR
 
350
options to indicate the directories in which the server and databases are located on your system.
 
351
.PP
 
352
Normally, you should not edit the
 
353
\fBmysqld_safe\fR
 
354
script. Instead, configure
 
355
\fBmysqld_safe\fR
 
356
by using command\-line options or options in the
 
357
[mysqld_safe]
 
358
section of a
 
359
\fImy.cnf\fR
 
360
option file. In rare cases, it might be necessary to edit
 
361
\fBmysqld_safe\fR
 
362
to get it to start the server properly. However, if you do this, your modified version of
 
363
\fBmysqld_safe\fR
 
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.
 
365
.PP
 
366
On NetWare,
 
367
\fBmysqld_safe\fR
 
368
is a NetWare Loadable Module (NLM) that is ported from the original Unix shell script. It starts the server as follows:
 
369
.TP 3n
 
370
1.
 
371
Runs a number of system and option checks.
 
372
.TP 3n
 
373
2.
 
374
Runs a check on
 
375
MyISAM
 
376
tables.
 
377
.TP 3n
 
378
3.
 
379
Provides a screen presence for the MySQL server.
 
380
.TP 3n
 
381
4.
 
382
Starts
 
383
\fBmysqld\fR, monitors it, and restarts it if it terminates in error.
 
384
.TP 3n
 
385
5.
 
386
Sends error messages from
 
387
\fBmysqld\fR
 
388
to the
 
389
\fI\fIhost_name\fR\fR\fI.err\fR
 
390
file in the data directory.
 
391
.TP 3n
 
392
6.
 
393
Sends
 
394
\fBmysqld_safe\fR
 
395
screen output to the
 
396
\fI\fIhost_name\fR\fR\fI.safe\fR
 
397
file in the data directory.
 
398
.SH "COPYRIGHT"
 
399
.PP
 
400
Copyright 1997\-2006 MySQL AB
 
401
.PP
 
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.
 
403
.PP
 
404
Please email
 
405
<docs@mysql.com>
 
406
for more information.
 
407
.SH "SEE ALSO"
 
408
msql2mysql(1),
 
409
my_print_defaults(1),
 
410
myisam_ftdump(1),
 
411
myisamchk(1),
 
412
myisamlog(1),
 
413
myisampack(1),
 
414
mysql(1),
 
415
mysql.server(1),
 
416
mysql_config(1),
 
417
mysql_explain_log(1),
 
418
mysql_fix_privilege_tables(1),
 
419
mysql_tzinfo_to_sql(1),
 
420
mysql_upgrade(1),
 
421
mysql_zap(1),
 
422
mysqlaccess(1),
 
423
mysqladmin(1),
 
424
mysqlbinlog(1),
 
425
mysqlcheck(1),
 
426
mysqld(8),
 
427
mysqld_multi(1),
 
428
mysqldump(1),
 
429
mysqlhotcopy(1),
 
430
mysqlimport(1),
 
431
mysqlmanager(8),
 
432
mysqlshow(1),
 
433
perror(1),
 
434
replace(1),
 
435
safe_mysqld(1)
 
436
.P
 
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/.
 
440
.SH AUTHOR
 
441
MySQL AB (http://www.mysql.com/).
 
442
This software comes with no warranty.