~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to man/mysqld_safe.1

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
'\" t
 
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/>
 
5
.\"      Date: 03/01/2010
 
6
.\"    Manual: MySQL Database System
 
7
.\"    Source: MySQL 5.1
 
8
.\"  Language: English
 
9
.\"
 
10
.TH "\FBMYSQLD_SAFE\FR" "1" "03/01/2010" "MySQL 5\&.1" "MySQL Database System"
 
11
.\" -----------------------------------------------------------------
 
12
.\" * set default formatting
 
13
.\" -----------------------------------------------------------------
 
14
.\" disable hyphenation
 
15
.nh
 
16
.\" disable justification (adjust text to left margin only)
 
17
.ad l
 
18
.\" -----------------------------------------------------------------
 
19
.\" * MAIN CONTENT STARTS HERE *
 
20
.\" -----------------------------------------------------------------
 
21
.\" mysqld_safe
 
22
.\" tools: mysqld_safe
 
23
.\" scripts
 
24
.SH "NAME"
 
25
mysqld_safe \- MySQL server startup script
 
26
.SH "SYNOPSIS"
 
27
.HP \w'\fBmysqld_safe\ \fR\fB\fIoptions\fR\fR\ 'u
 
28
\fBmysqld_safe \fR\fB\fIoptions\fR\fR
 
29
.SH "DESCRIPTION"
 
30
.PP
 
31
\fBmysqld_safe\fR
 
32
is the recommended way to start a
 
33
\fBmysqld\fR
 
34
server on Unix and NetWare\&.
 
35
\fBmysqld_safe\fR
 
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\&.
 
37
.if n \{\
 
38
.sp
 
39
.\}
 
40
.RS 4
 
41
.it 1 an-trap
 
42
.nr an-no-space-flag 1
 
43
.nr an-break-flag 1
 
44
.br
 
45
.ps +1
 
46
\fBNote\fR
 
47
.ps -1
 
48
.br
 
49
.PP
 
50
In MySQL 5\&.1\&.20 (only), the default error logging behavior with
 
51
\fBmysqld_safe\fR
 
52
is to write errors to
 
53
syslog
 
54
on systems that support the
 
55
\fBlogger\fR
 
56
program\&. This differs from the default behavior of writing an error log file for other versions\&.
 
57
.PP
 
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
 
59
.sp .5v
 
60
.RE
 
61
.PP
 
62
\fBmysqld_safe\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
 
65
\fB\-\-mysqld\fR
 
66
or
 
67
\fB\-\-mysqld\-version\fR
 
68
option to
 
69
\fBmysqld_safe\fR\&. You can also use
 
70
\fB\-\-ledir\fR
 
71
to indicate the directory where
 
72
\fBmysqld_safe\fR
 
73
should look for the server\&.
 
74
.PP
 
75
Many of the options to
 
76
\fBmysqld_safe\fR
 
77
are the same as the options to
 
78
\fBmysqld\fR\&. See
 
79
Section\ \&5.1.2, \(lqServer Command Options\(rq\&.
 
80
.PP
 
81
Options unknown to
 
82
\fBmysqld_safe\fR
 
83
are passed to
 
84
\fBmysqld\fR
 
85
if they are specified on the command line, but ignored if they are specified in the
 
86
[mysqld_safe]
 
87
group of an option file\&. See
 
88
Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&.
 
89
.PP
 
90
\fBmysqld_safe\fR
 
91
reads all options from the
 
92
[mysqld],
 
93
[server], and
 
94
[mysqld_safe]
 
95
sections in option files\&. For example, if you specify a
 
96
[mysqld]
 
97
section like this,
 
98
\fBmysqld_safe\fR
 
99
will find and use the
 
100
\fB\-\-log\-error\fR
 
101
option:
 
102
.sp
 
103
.if n \{\
 
104
.RS 4
 
105
.\}
 
106
.nf
 
107
[mysqld]
 
108
log\-error=error\&.log
 
109
.fi
 
110
.if n \{\
 
111
.RE
 
112
.\}
 
113
.PP
 
114
For backward compatibility,
 
115
\fBmysqld_safe\fR
 
116
also reads
 
117
[safe_mysqld]
 
118
sections, although you should rename such sections to
 
119
[mysqld_safe]
 
120
in MySQL 5\&.1 installations\&.
 
121
.PP
 
122
\fBmysqld_safe\fR
 
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\&.
 
125
.sp
 
126
.RS 4
 
127
.ie n \{\
 
128
\h'-04'\(bu\h'+03'\c
 
129
.\}
 
130
.el \{\
 
131
.sp -1
 
132
.IP \(bu 2.3
 
133
.\}
 
134
.\" mysqld_safe: help option
 
135
.\" help option: mysqld_safe
 
136
\fB\-\-help\fR
 
137
.sp
 
138
Display a help message and exit\&.
 
139
.RE
 
140
.sp
 
141
.RS 4
 
142
.ie n \{\
 
143
\h'-04'\(bu\h'+03'\c
 
144
.\}
 
145
.el \{\
 
146
.sp -1
 
147
.IP \(bu 2.3
 
148
.\}
 
149
.\" mysqld_safe: autoclose option
 
150
.\" autoclose option: mysqld_safe
 
151
\fB\-\-autoclose\fR
 
152
.sp
 
153
(NetWare only) On NetWare,
 
154
\fBmysqld_safe\fR
 
155
provides a screen presence\&. When you unload (shut down) the
 
156
\fBmysqld_safe\fR
 
157
NLM, the screen does not by default go away\&. Instead, it prompts for user input:
 
158
.sp
 
159
.if n \{\
 
160
.RS 4
 
161
.\}
 
162
.nf
 
163
*<NLM has terminated; Press any key to close the screen>*
 
164
.fi
 
165
.if n \{\
 
166
.RE
 
167
.\}
 
168
.sp
 
169
If you want NetWare to close the screen automatically instead, use the
 
170
\fB\-\-autoclose\fR
 
171
option to
 
172
\fBmysqld_safe\fR\&.
 
173
.RE
 
174
.sp
 
175
.RS 4
 
176
.ie n \{\
 
177
\h'-04'\(bu\h'+03'\c
 
178
.\}
 
179
.el \{\
 
180
.sp -1
 
181
.IP \(bu 2.3
 
182
.\}
 
183
.\" mysqld_safe: basedir option
 
184
.\" basedir option: mysqld_safe
 
185
\fB\-\-basedir=\fR\fB\fIpath\fR\fR
 
186
.sp
 
187
The path to the MySQL installation directory\&.
 
188
.RE
 
189
.sp
 
190
.RS 4
 
191
.ie n \{\
 
192
\h'-04'\(bu\h'+03'\c
 
193
.\}
 
194
.el \{\
 
195
.sp -1
 
196
.IP \(bu 2.3
 
197
.\}
 
198
.\" mysqld_safe: core-file-size option
 
199
.\" core-file-size option: mysqld_safe
 
200
\fB\-\-core\-file\-size=\fR\fB\fIsize\fR\fR
 
201
.sp
 
202
The size of the core file that
 
203
\fBmysqld\fR
 
204
should be able to create\&. The option value is passed to
 
205
\fBulimit \-c\fR\&.
 
206
.RE
 
207
.sp
 
208
.RS 4
 
209
.ie n \{\
 
210
\h'-04'\(bu\h'+03'\c
 
211
.\}
 
212
.el \{\
 
213
.sp -1
 
214
.IP \(bu 2.3
 
215
.\}
 
216
.\" mysqld_safe: datadir option
 
217
.\" datadir option: mysqld_safe
 
218
\fB\-\-datadir=\fR\fB\fIpath\fR\fR
 
219
.sp
 
220
The path to the data directory\&.
 
221
.RE
 
222
.sp
 
223
.RS 4
 
224
.ie n \{\
 
225
\h'-04'\(bu\h'+03'\c
 
226
.\}
 
227
.el \{\
 
228
.sp -1
 
229
.IP \(bu 2.3
 
230
.\}
 
231
.\" mysqld_safe: defaults-extra-file option
 
232
.\" defaults-extra-file option: mysqld_safe
 
233
\fB\-\-defaults\-extra\-file=\fR\fB\fIpath\fR\fR
 
234
.sp
 
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\&.
 
236
.RE
 
237
.sp
 
238
.RS 4
 
239
.ie n \{\
 
240
\h'-04'\(bu\h'+03'\c
 
241
.\}
 
242
.el \{\
 
243
.sp -1
 
244
.IP \(bu 2.3
 
245
.\}
 
246
.\" mysqld_safe: defaults-file option
 
247
.\" defaults-file option: mysqld_safe
 
248
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
 
249
.sp
 
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\&.
 
251
.RE
 
252
.sp
 
253
.RS 4
 
254
.ie n \{\
 
255
\h'-04'\(bu\h'+03'\c
 
256
.\}
 
257
.el \{\
 
258
.sp -1
 
259
.IP \(bu 2.3
 
260
.\}
 
261
.\" mysqld_safe: ledir option
 
262
.\" ledir option: mysqld_safe
 
263
\fB\-\-ledir=\fR\fB\fIpath\fR\fR
 
264
.sp
 
265
If
 
266
\fBmysqld_safe\fR
 
267
cannot find the server, use this option to indicate the path name to the directory where the server is located\&.
 
268
.RE
 
269
.sp
 
270
.RS 4
 
271
.ie n \{\
 
272
\h'-04'\(bu\h'+03'\c
 
273
.\}
 
274
.el \{\
 
275
.sp -1
 
276
.IP \(bu 2.3
 
277
.\}
 
278
.\" mysqld_safe: log-error option
 
279
.\" log-error option: mysqld_safe
 
280
\fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR
 
281
.sp
 
282
Write the error log to the given file\&. See
 
283
Section\ \&5.2.2, \(lqThe Error Log\(rq\&.
 
284
.RE
 
285
.sp
 
286
.RS 4
 
287
.ie n \{\
 
288
\h'-04'\(bu\h'+03'\c
 
289
.\}
 
290
.el \{\
 
291
.sp -1
 
292
.IP \(bu 2.3
 
293
.\}
 
294
.\" mysqld_safe: mysqld option
 
295
.\" mysqld option: mysqld_safe
 
296
\fB\-\-mysqld=\fR\fB\fIprog_name\fR\fR
 
297
.sp
 
298
The name of the server program (in the
 
299
ledir
 
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
 
301
\fBmysqld_safe\fR
 
302
cannot find the server, use the
 
303
\fB\-\-ledir\fR
 
304
option to indicate the path name to the directory where the server is located\&.
 
305
.RE
 
306
.sp
 
307
.RS 4
 
308
.ie n \{\
 
309
\h'-04'\(bu\h'+03'\c
 
310
.\}
 
311
.el \{\
 
312
.sp -1
 
313
.IP \(bu 2.3
 
314
.\}
 
315
.\" mysqld_safe: mysqld-version option
 
316
.\" mysqld-version option: mysqld_safe
 
317
\fB\-\-mysqld\-version=\fR\fB\fIsuffix\fR\fR
 
318
.sp
 
319
This option is similar to the
 
320
\fB\-\-mysqld\fR
 
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,
 
324
\fBmysqld_safe\fR
 
325
starts the
 
326
\fBmysqld\-debug\fR
 
327
program in the
 
328
ledir
 
329
directory\&. If the argument to
 
330
\fB\-\-mysqld\-version\fR
 
331
is empty,
 
332
\fBmysqld_safe\fR
 
333
uses
 
334
\fBmysqld\fR
 
335
in the
 
336
ledir
 
337
directory\&.
 
338
.RE
 
339
.sp
 
340
.RS 4
 
341
.ie n \{\
 
342
\h'-04'\(bu\h'+03'\c
 
343
.\}
 
344
.el \{\
 
345
.sp -1
 
346
.IP \(bu 2.3
 
347
.\}
 
348
.\" mysqld_safe: nice option
 
349
.\" nice option: mysqld_safe
 
350
\fB\-\-nice=\fR\fB\fIpriority\fR\fR
 
351
.sp
 
352
Use the
 
353
nice
 
354
program to set the server\'s scheduling priority to the given value\&.
 
355
.RE
 
356
.sp
 
357
.RS 4
 
358
.ie n \{\
 
359
\h'-04'\(bu\h'+03'\c
 
360
.\}
 
361
.el \{\
 
362
.sp -1
 
363
.IP \(bu 2.3
 
364
.\}
 
365
.\" mysqld_safe: no-defaults option
 
366
.\" no-defaults option: mysqld_safe
 
367
\fB\-\-no\-defaults\fR
 
368
.sp
 
369
Do not read any option files\&. This must be the first option on the command line if it is used\&.
 
370
.RE
 
371
.sp
 
372
.RS 4
 
373
.ie n \{\
 
374
\h'-04'\(bu\h'+03'\c
 
375
.\}
 
376
.el \{\
 
377
.sp -1
 
378
.IP \(bu 2.3
 
379
.\}
 
380
.\" mysqld_safe: open-files-limit option
 
381
.\" open-files-limit option: mysqld_safe
 
382
\fB\-\-open\-files\-limit=\fR\fB\fIcount\fR\fR
 
383
.sp
 
384
The number of files that
 
385
\fBmysqld\fR
 
386
should be able to open\&. The option value is passed to
 
387
\fBulimit \-n\fR\&. Note that you need to start
 
388
\fBmysqld_safe\fR
 
389
as
 
390
root
 
391
for this to work properly!
 
392
.RE
 
393
.sp
 
394
.RS 4
 
395
.ie n \{\
 
396
\h'-04'\(bu\h'+03'\c
 
397
.\}
 
398
.el \{\
 
399
.sp -1
 
400
.IP \(bu 2.3
 
401
.\}
 
402
.\" mysqld_safe: pid-file option
 
403
.\" pid-file option: mysqld_safe
 
404
\fB\-\-pid\-file=\fR\fB\fIfile_name\fR\fR
 
405
.sp
 
406
The path name of the process ID file\&.
 
407
.RE
 
408
.sp
 
409
.RS 4
 
410
.ie n \{\
 
411
\h'-04'\(bu\h'+03'\c
 
412
.\}
 
413
.el \{\
 
414
.sp -1
 
415
.IP \(bu 2.3
 
416
.\}
 
417
.\" mysqld_safe: port option
 
418
.\" port option: mysqld_safe
 
419
\fB\-\-port=\fR\fB\fIport_num\fR\fR
 
420
.sp
 
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
 
422
root
 
423
system user\&.
 
424
.RE
 
425
.sp
 
426
.RS 4
 
427
.ie n \{\
 
428
\h'-04'\(bu\h'+03'\c
 
429
.\}
 
430
.el \{\
 
431
.sp -1
 
432
.IP \(bu 2.3
 
433
.\}
 
434
.\" mysqld_safe: skip-kill-mysqld option
 
435
.\" skip-kill-mysqld option: mysqld_safe
 
436
\fB\-\-skip\-kill\-mysqld\fR
 
437
.sp
 
438
Do not try to kill stray
 
439
\fBmysqld\fR
 
440
processes at startup\&. This option works only on Linux\&.
 
441
.RE
 
442
.sp
 
443
.RS 4
 
444
.ie n \{\
 
445
\h'-04'\(bu\h'+03'\c
 
446
.\}
 
447
.el \{\
 
448
.sp -1
 
449
.IP \(bu 2.3
 
450
.\}
 
451
.\" mysqld_safe: socket option
 
452
.\" socket option: mysqld_safe
 
453
\fB\-\-socket=\fR\fB\fIpath\fR\fR
 
454
.sp
 
455
The Unix socket file that the server should use when listening for local connections\&.
 
456
.RE
 
457
.sp
 
458
.RS 4
 
459
.ie n \{\
 
460
\h'-04'\(bu\h'+03'\c
 
461
.\}
 
462
.el \{\
 
463
.sp -1
 
464
.IP \(bu 2.3
 
465
.\}
 
466
.\" mysqld_safe: syslog option
 
467
.\" syslog option: mysqld_safe
 
468
.\" mysqld_safe: skip-syslog option
 
469
.\" skip-syslog option: mysqld_safe
 
470
\fB\-\-syslog\fR,
 
471
\fB\-\-skip\-syslog\fR
 
472
.sp
 
473
\fB\-\-syslog\fR
 
474
causes error messages to be sent to
 
475
syslog
 
476
on systems that support the
 
477
\fBlogger\fR
 
478
program\&.
 
479
\-\-skip\-syslog
 
480
suppresses the use of
 
481
syslog; messages are written to an error log file\&. These options were added in MySQL 5\&.1\&.20\&.
 
482
.RE
 
483
.sp
 
484
.RS 4
 
485
.ie n \{\
 
486
\h'-04'\(bu\h'+03'\c
 
487
.\}
 
488
.el \{\
 
489
.sp -1
 
490
.IP \(bu 2.3
 
491
.\}
 
492
.\" mysqld_safe: syslog-tag option
 
493
.\" syslog-tag option: mysqld_safe
 
494
\fB\-\-syslog\-tag=\fR\fB\fItag\fR\fR
 
495
.sp
 
496
For logging to
 
497
syslog, messages from
 
498
\fBmysqld_safe\fR
 
499
and
 
500
\fBmysqld\fR
 
501
are written with a tag of
 
502
mysqld_safe
 
503
and
 
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
 
507
and
 
508
mysqld\-\fItag\fR\&. This option was added in MySQL 5\&.1\&.21\&.
 
509
.RE
 
510
.sp
 
511
.RS 4
 
512
.ie n \{\
 
513
\h'-04'\(bu\h'+03'\c
 
514
.\}
 
515
.el \{\
 
516
.sp -1
 
517
.IP \(bu 2.3
 
518
.\}
 
519
.\" mysqld_safe: timezone option
 
520
.\" timezone option: mysqld_safe
 
521
\fB\-\-timezone=\fR\fB\fItimezone\fR\fR
 
522
.sp
 
523
Set the
 
524
TZ
 
525
time zone environment variable to the given option value\&. Consult your operating system documentation for legal time zone specification formats\&.
 
526
.RE
 
527
.sp
 
528
.RS 4
 
529
.ie n \{\
 
530
\h'-04'\(bu\h'+03'\c
 
531
.\}
 
532
.el \{\
 
533
.sp -1
 
534
.IP \(bu 2.3
 
535
.\}
 
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
 
539
.sp
 
540
Run the
 
541
\fBmysqld\fR
 
542
server as the user having the name
 
543
\fIuser_name\fR
 
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\&.)
 
547
.RE
 
548
.PP
 
549
If you execute
 
550
\fBmysqld_safe\fR
 
551
with the
 
552
\fB\-\-defaults\-file\fR
 
553
or
 
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:
 
556
.sp
 
557
.if n \{\
 
558
.RS 4
 
559
.\}
 
560
.nf
 
561
mysql> \fBmysqld_safe \-\-port=\fR\fB\fIport_num\fR\fR\fB \-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
 
562
.fi
 
563
.if n \{\
 
564
.RE
 
565
.\}
 
566
.PP
 
567
Instead, use the following command:
 
568
.sp
 
569
.if n \{\
 
570
.RS 4
 
571
.\}
 
572
.nf
 
573
mysql> \fBmysqld_safe \-\-defaults\-file=\fR\fB\fIfile_name\fR\fR\fB \-\-port=\fR\fB\fIport_num\fR\fR
 
574
.fi
 
575
.if n \{\
 
576
.RE
 
577
.\}
 
578
.PP
 
579
The
 
580
\fBmysqld_safe\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\&.)
 
583
\fBmysqld_safe\fR
 
584
expects one of the following conditions to be true:
 
585
.sp
 
586
.RS 4
 
587
.ie n \{\
 
588
\h'-04'\(bu\h'+03'\c
 
589
.\}
 
590
.el \{\
 
591
.sp -1
 
592
.IP \(bu 2.3
 
593
.\}
 
594
The server and databases can be found relative to the working directory (the directory from which
 
595
\fBmysqld_safe\fR
 
596
is invoked)\&. For binary distributions,
 
597
\fBmysqld_safe\fR
 
598
looks under its working directory for
 
599
bin
 
600
and
 
601
data
 
602
directories\&. For source distributions, it looks for
 
603
libexec
 
604
and
 
605
var
 
606
directories\&. This condition should be met if you execute
 
607
\fBmysqld_safe\fR
 
608
from your MySQL installation directory (for example,
 
609
/usr/local/mysql
 
610
for a binary distribution)\&.
 
611
.RE
 
612
.sp
 
613
.RS 4
 
614
.ie n \{\
 
615
\h'-04'\(bu\h'+03'\c
 
616
.\}
 
617
.el \{\
 
618
.sp -1
 
619
.IP \(bu 2.3
 
620
.\}
 
621
If the server and databases cannot be found relative to the working directory,
 
622
\fBmysqld_safe\fR
 
623
attempts to locate them by absolute path names\&. Typical locations are
 
624
/usr/local/libexec
 
625
and
 
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\&.
 
627
.RE
 
628
.PP
 
629
Because
 
630
\fBmysqld_safe\fR
 
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
 
632
\fBmysqld_safe\fR
 
633
from the MySQL installation directory:
 
634
.sp
 
635
.if n \{\
 
636
.RS 4
 
637
.\}
 
638
.nf
 
639
shell> \fBcd \fR\fB\fImysql_installation_directory\fR\fR
 
640
shell> \fBbin/mysqld_safe &\fR
 
641
.fi
 
642
.if n \{\
 
643
.RE
 
644
.\}
 
645
.PP
 
646
If
 
647
\fBmysqld_safe\fR
 
648
fails, even when invoked from the MySQL installation directory, you can specify the
 
649
\fB\-\-ledir\fR
 
650
and
 
651
\fB\-\-datadir\fR
 
652
options to indicate the directories in which the server and databases are located on your system\&.
 
653
.PP
 
654
When you use
 
655
\fBmysqld_safe\fR
 
656
to start
 
657
\fBmysqld\fR,
 
658
\fBmysqld_safe\fR
 
659
arranges for error (and notice) messages from itself and from
 
660
\fBmysqld\fR
 
661
to go to the same destination\&.
 
662
.PP
 
663
As of MySQL 5\&.1\&.20, there are several
 
664
\fBmysqld_safe\fR
 
665
options for controlling the destination of these messages:
 
666
.sp
 
667
.RS 4
 
668
.ie n \{\
 
669
\h'-04'\(bu\h'+03'\c
 
670
.\}
 
671
.el \{\
 
672
.sp -1
 
673
.IP \(bu 2.3
 
674
.\}
 
675
\fB\-\-syslog\fR: Write error messages to
 
676
syslog
 
677
on systems that support the
 
678
\fBlogger\fR
 
679
program\&.
 
680
.RE
 
681
.sp
 
682
.RS 4
 
683
.ie n \{\
 
684
\h'-04'\(bu\h'+03'\c
 
685
.\}
 
686
.el \{\
 
687
.sp -1
 
688
.IP \(bu 2.3
 
689
.\}
 
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
 
693
\fB\-\-log\-error\fR
 
694
option is given\&.
 
695
.RE
 
696
.sp
 
697
.RS 4
 
698
.ie n \{\
 
699
\h'-04'\(bu\h'+03'\c
 
700
.\}
 
701
.el \{\
 
702
.sp -1
 
703
.IP \(bu 2.3
 
704
.\}
 
705
\fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR: Write error messages to the named error file\&.
 
706
.RE
 
707
.PP
 
708
If none of these options is given, the default is
 
709
\fB\-\-skip\-syslog\fR\&.
 
710
.if n \{\
 
711
.sp
 
712
.\}
 
713
.RS 4
 
714
.it 1 an-trap
 
715
.nr an-no-space-flag 1
 
716
.nr an-break-flag 1
 
717
.br
 
718
.ps +1
 
719
\fBNote\fR
 
720
.ps -1
 
721
.br
 
722
.PP
 
723
In MySQL 5\&.1\&.20
 
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\&.
 
726
.sp .5v
 
727
.RE
 
728
.PP
 
729
If
 
730
\fB\-\-syslog\fR
 
731
and
 
732
\fB\-\-log\-error\fR
 
733
are both given, a warning is issued and
 
734
\fB\-\-log\-error\fR
 
735
takes precedence\&.
 
736
.PP
 
737
When
 
738
\fBmysqld_safe\fR
 
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
 
742
stderr\&.
 
743
.PP
 
744
Before MySQL 5\&.1\&.20, error logging is controlled only with the
 
745
\fB\-\-log\-error\fR
 
746
option\&. If it is given, messages go to the named error file\&. Otherwise, messages go to the default error file\&.
 
747
.PP
 
748
Normally, you should not edit the
 
749
\fBmysqld_safe\fR
 
750
script\&. Instead, configure
 
751
\fBmysqld_safe\fR
 
752
by using command\-line options or options in the
 
753
[mysqld_safe]
 
754
section of a
 
755
my\&.cnf
 
756
option file\&. In rare cases, it might be necessary to edit
 
757
\fBmysqld_safe\fR
 
758
to get it to start the server properly\&. However, if you do this, your modified version of
 
759
\fBmysqld_safe\fR
 
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\&.
 
761
.PP
 
762
On NetWare,
 
763
\fBmysqld_safe\fR
 
764
is a NetWare Loadable Module (NLM) that is ported from the original Unix shell script\&. It starts the server as follows:
 
765
.sp
 
766
.RS 4
 
767
.ie n \{\
 
768
\h'-04' 1.\h'+01'\c
 
769
.\}
 
770
.el \{\
 
771
.sp -1
 
772
.IP "  1." 4.2
 
773
.\}
 
774
Runs a number of system and option checks\&.
 
775
.RE
 
776
.sp
 
777
.RS 4
 
778
.ie n \{\
 
779
\h'-04' 2.\h'+01'\c
 
780
.\}
 
781
.el \{\
 
782
.sp -1
 
783
.IP "  2." 4.2
 
784
.\}
 
785
Runs a check on
 
786
MyISAM
 
787
tables\&.
 
788
.RE
 
789
.sp
 
790
.RS 4
 
791
.ie n \{\
 
792
\h'-04' 3.\h'+01'\c
 
793
.\}
 
794
.el \{\
 
795
.sp -1
 
796
.IP "  3." 4.2
 
797
.\}
 
798
Provides a screen presence for the MySQL server\&.
 
799
.RE
 
800
.sp
 
801
.RS 4
 
802
.ie n \{\
 
803
\h'-04' 4.\h'+01'\c
 
804
.\}
 
805
.el \{\
 
806
.sp -1
 
807
.IP "  4." 4.2
 
808
.\}
 
809
Starts
 
810
\fBmysqld\fR, monitors it, and restarts it if it terminates in error\&.
 
811
.RE
 
812
.sp
 
813
.RS 4
 
814
.ie n \{\
 
815
\h'-04' 5.\h'+01'\c
 
816
.\}
 
817
.el \{\
 
818
.sp -1
 
819
.IP "  5." 4.2
 
820
.\}
 
821
Sends error messages from
 
822
\fBmysqld\fR
 
823
to the
 
824
\fIhost_name\fR\&.err
 
825
file in the data directory\&.
 
826
.RE
 
827
.sp
 
828
.RS 4
 
829
.ie n \{\
 
830
\h'-04' 6.\h'+01'\c
 
831
.\}
 
832
.el \{\
 
833
.sp -1
 
834
.IP "  6." 4.2
 
835
.\}
 
836
Sends
 
837
\fBmysqld_safe\fR
 
838
screen output to the
 
839
\fIhost_name\fR\&.safe
 
840
file in the data directory\&.
 
841
.RE
 
842
.SH "COPYRIGHT"
 
843
.br
 
844
.PP
 
845
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
 
846
.PP
 
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.
 
848
.PP
 
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.
 
850
.PP
 
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/.
 
852
.sp
 
853
.SH "SEE ALSO"
 
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/.
 
857
.SH AUTHOR
 
858
Sun Microsystems, Inc. (http://www.mysql.com/).