1MYSQL_INSTALL_DB() MYSQL_INSTALL_DB()
2
3
4
6 mysql_install_db - initialize MySQL data directory
7
9 mysql_install_db [options]
10
12 mysql_install_db initializes the MySQL data directory and creates the
13 system tables that it contains, if they do not exist.
14
15 To invoke mysql_install_db, use the following syntax:
16
17 shell> mysql_install_db [options]
18
19 Because the MySQL server, mysqld, needs to access the data directory
20 when it runs later, you should either run mysql_install_db from the
21 same account that will be used for running mysqld or run it as root and
22 use the --user option to indicate the user name that mysqld will run
23 as. It might be necessary to specify other options such as --basedir or
24 --datadir if mysql_install_db does not use the correct locations for
25 the installation directory or data directory. For example:
26
27 shell> bin/mysql_install_db --user=mysql \
28 --basedir=/opt/mysql/mysql \
29 --datadir=/opt/mysql/mysql/data
30
31 mysql_install_db needs to invoke mysqld with the --bootstrap and
32 --skip-grant-tables options. If MySQL was configured with the
33 --disable-grant-options option, --bootstrap and --skip-grant-tables
34 will be disabled (see Section 2.11.4, “MySQL Source-Configuration
35 Options”). To handle this, set the MYSQLD_BOOTSTRAP environment
36 variable to the full path name of a server that has all options
37 enabled. mysql_install_db will use that server.
38
39 Note
40 If you have set a custom TMPDIR variable when performing the
41 installation, and the specified directory is not accessible, the
42 execution of mysql_install_db may fail. You should unset TMPDIR, or
43 set TMPDIR to point to the system temporary directory (usually
44 /tmp).
45
46 mysql_install_db supports the following options, which can be specified
47 on the command line or in the [mysql_install_db] and (if they are
48 common to mysqld) [mysqld] groups of an option file. Other options are
49 passed to mysqld. For information about option files, see
50 Section 4.2.3.3, “Using Option Files”. mysql_install_db also supports
51 the options for processing option files described at Section 4.2.3.3.1,
52 “Command-Line Options that Affect Option-File Handling”.
53
54 · --basedir=path
55
56 The path to the MySQL installation directory.
57
58 · --force
59
60 Cause mysql_install_db to run even if DNS does not work. In that
61 case, grant table entries that normally use host names will use IP
62 addresses.
63
64 · --datadir=path, --ldata=path
65
66 The path to the MySQL data directory.
67
68 · --rpm
69
70 For internal use. This option is used by RPM files during the MySQL
71 installation process.
72
73 · --skip-name-resolve
74
75 Use IP addresses rather than host names when creating grant table
76 entries. This option can be useful if your DNS does not work.
77
78 · --srcdir=path
79
80 For internal use. The directory under which mysql_install_db looks
81 for support files such as the error message file and the file for
82 populating the help tables. This option was added in MySQL 5.1.14.
83
84 · --user=user_name
85
86 The login user name to use for running mysqld. Files and
87 directories created by mysqld will be owned by this user. You must
88 be root to use this option. By default, mysqld runs using your
89 current login name and files and directories that it creates will
90 be owned by you.
91
92 · --verbose
93
94 Verbose mode. Print more information about what the program does.
95
96 · --windows
97
98 For internal use. This option is used for creating Windows
99 distributions.
100
102 Copyright © 1997, 2011, Oracle and/or its affiliates. All rights
103 reserved.
104
105 This documentation is free software; you can redistribute it and/or
106 modify it only under the terms of the GNU General Public License as
107 published by the Free Software Foundation; version 2 of the License.
108
109 This documentation is distributed in the hope that it will be useful,
110 but WITHOUT ANY WARRANTY; without even the implied warranty of
111 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
112 General Public License for more details.
113
114 You should have received a copy of the GNU General Public License along
115 with the program; if not, write to the Free Software Foundation, Inc.,
116 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see
117 http://www.gnu.org/licenses/.
118
119
121 For more information, please refer to the MySQL Reference Manual, which
122 may already be installed locally and which is also available online at
123 http://dev.mysql.com/doc/.
124
126 Oracle Corporation (http://dev.mysql.com/).
127
128
129
130 MYSQL_INSTALL_DB()