1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
|
'\" t
.\"
.TH "\FBMYSQL_INSTALL_DB\FR" "1" "4 April 2019" "MariaDB 10\&.3" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.\" mysql_install_db
.SH "NAME"
mysql_install_db \- initialize MariaDB data directory
.SH "SYNOPSIS"
.HP \w'\fBmysql_install_db\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u
\fBmysql_install_db [\fR\fB\fIoptions\fR\fR\fB]\fR
.SH "DESCRIPTION"
.PP
\fBmysql_install_db\fR
initializes the MariaDB data directory and creates the system tables that it contains, if they do not exist\&.
.PP
To invoke
\fBmysql_install_db\fR, use the following syntax:
.sp
.if n \{\
.RS 4
.\}
.nf
shell> \fBmysql_install_db [\fR\fB\fIoptions\fR\fR\fB]\fR
.fi
.if n \{\
.RE
.\}
.PP
Because the MariaDB server,
\fBmysqld\fR, needs to access the data directory when it runs later, you should either run
\fBmysql_install_db\fR
from the same account that will be used for running
\fBmysqld\fR
or run it as
root
and use the
\fB\-\-user\fR
option to indicate the user name that
\fBmysqld\fR
will run as\&. It might be necessary to specify other options such as
\fB\-\-basedir\fR
or
\fB\-\-datadir\fR
if
\fBmysql_install_db\fR
does not use the correct locations for the installation directory or data directory\&. For example:
.sp
.if n \{\
.RS 4
.\}
.nf
shell> \fBbin/mysql_install_db \-\-user=mysql \e\fR
\fB\-\-basedir=/opt/mysql/mysql \e\fR
\fB\-\-datadir=/opt/mysql/mysql/data\fR
.fi
.if n \{\
.RE
.\}
.PP
\fBmysql_install_db\fR
needs to invoke
\fBmysqld\fR
with the
\fB\-\-bootstrap\fR
and
\fB\-\-skip\-grant\-tables\fR
options (see
Section\ \&2.3.2, \(lqTypical configure Options\(rq)\&. If MariaDB was configured with the
\fB\-\-disable\-grant\-options\fR
option,
\fB\-\-bootstrap\fR
and
\fB\-\-skip\-grant\-tables\fR
will be disabled\&. To handle this, set the
MYSQLD_BOOTSTRAP
environment variable to the full path name of a server that has all options enabled\&.
\fBmysql_install_db\fR
will use that server\&.
.PP
\fBmysql_install_db\fR
supports the following options, which can be specified on the command line or in the
[mysql_install_db]
and (if they are common to
\fBmysqld\fR)
[mysqld]
option file groups\&.
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_install_db: basedir option
.\" basedir option: mysql_install_db
\fB\-\-basedir=\fR\fB\fIpath\fR\fR
.sp
The path to the MariaDB installation directory\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_install_db: builddir option
.\" builddir option: mysql_install_db
\fB\-\-builddir=\fIpath\fR
.sp
If using \fB--srcdir\fR with out-of-directory builds, you will need to set this
to the location of the build directory where built files reside.\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_install_db: cross-bootstrap option
.\" cross-bootstrap option: mysql_install_db
\fB\-\-cross\-bootstrap\fR
.sp
For internal use. Used when building the MariaDB system tables on a different host than the target.\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_install_db: datadir option
.\" datadir option: mysql_install_db
.\" mysql_install_db: ldata option
.\" ldata option: mysql_install_db
\fB\-\-datadir=\fR\fB\fIpath\fR\fR,
\fB\-\-ldata=\fR\fB\fIpath\fR\fR
.sp
The path to the MariaDB data directory\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysqlcheck: defaults-extra-file option
.\" defaults-extra-file option: mysqlcheck
\fB\-\-defaults\-extra\-file=\fR\fB\fIfilename\fR\fR
.sp
Set \fB\fIfilename\fR\fR as the file to read default options from after the global defaults files has been read\&.
Must be given as first option\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysqlcheck: defaults-file option
.\" defaults-file option: mysqlcheck
\fB\-\-defaults\-file=\fR\fB\fIfilename\fR\fR
.sp
Set \fB\fIfilename\fR\fR as the file to read default options from, override global defaults files\&.
Must be given as first option\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_install_db: defaults-group-suffix option
.\" defaults-group-suffix option: mysql_install_db
\fB\-\-defaults\-group\-suffix=\fR\fB\fIname\fR\fR
.sp
In addition to the given groups, also read groups with this suffix\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_install_db: force option
.\" force option: mysql_install_db
\fB\-\-force\fR
.sp
Cause
\fBmysql_install_db\fR
to run even if DNS does not work\&. In that case, grant table entries that normally use host names will use IP addresses\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysqlcheck: help option
.\" help option: mysqlcheck
\fB\-\-help\fR
.sp
Display a help message and exit\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysqlcheck: no-defaults option
.\" no-defaults option: mysqlcheck
\fB\-\-no\-defaults\fR
.sp
Do not read default options from any option file\&. This must be given as the first argument\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysqlcheck: print-defaults option
.\" print-defaults option: mysqlcheck
\fB\-\-print\-defaults\fR
.sp
Print the program argument list and exit\&.
This must be given as the first argument\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_install_db: rpm option
.\" rpm option: mysql_install_db
\fB\-\-rpm\fR
.sp
For internal use\&. This option is used by RPM files during the MariaDB installation process\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_install_db: skip-name-resolve option
.\" skip-name-resolve option: mysql_install_db
\fB\-\-skip\-name\-resolve\fR
.sp
Use IP addresses rather than host names when creating grant table entries\&. This option can be useful if your DNS does not work\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_install_db: srcdir option
.\" srcdir option: mysql_install_db
\fB\-\-srcdir=\fR\fB\fIpath\fR\fR
.sp
For internal use\&. The directory under which
\fBmysql_install_db\fR
looks for support files such as the error message file and the file for populating the help tables\&.4\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_install_db: user option
.\" user option: mysql_install_db
\fB\-\-user=\fR\fB\fIuser_name\fR\fR
.sp
The login user name to use for running
\fBmysqld\fR\&. Files and directories created by
\fBmysqld\fR
will be owned by this user\&. You must be
root
to use this option\&. By default,
\fBmysqld\fR
runs using your current login name and files and directories that it creates will be owned by you\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_install_db: verbose option
.\" verbose option: mysql_install_db
\fB\-\-verbose\fR
.sp
Verbose mode\&. Print more information about what the program does\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_install_db: windows option
.\" windows option: mysql_install_db
\fB\-\-windows\fR
.sp
For internal use\&. This option is used for creating Windows distributions\&.
.RE
.SH "COPYRIGHT"
.br
.PP
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2019 MariaDB Foundation
.PP
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.
.PP
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.
.PP
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/.
.sp
.SH "SEE ALSO"
For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
.SH AUTHOR
MariaDB Foundation (http://www.mariadb.org/).
|