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 (see Section 2.3.2, “Typical configure
33 Options”). If MySQL was configured with the --disable-grant-options
34 option, --bootstrap and --skip-grant-tables will be disabled. To handle
35 this, set the MYSQLD_BOOTSTRAP environment variable to the full path
36 name of a server that has all options enabled. mysql_install_db will
37 use that server.
38
39 mysql_install_db supports the following options, which can be specified
40 on the command line or in the [mysql_install_db] and (if they are
41 common to mysqld) [mysqld] option file groups.
42
43 · --basedir=path
44
45 The path to the MySQL installation directory.
46
47 · --force
48
49 Cause mysql_install_db to run even if DNS does not work. In that
50 case, grant table entries that normally use host names will use IP
51 addresses.
52
53 · --datadir=path, --ldata=path
54
55 The path to the MySQL data directory.
56
57 · --rpm
58
59 For internal use. This option is used by RPM files during the MySQL
60 installation process.
61
62 · --skip-name-resolve
63
64 Use IP addresses rather than host names when creating grant table
65 entries. This option can be useful if your DNS does not work.
66
67 · --srcdir=path
68
69 For internal use. The directory under which mysql_install_db looks
70 for support files such as the error message file and the file for
71 populating the help tables. This option was added in MySQL 5.1.14.
72
73 · --user=user_name
74
75 The login user name to use for running mysqld. Files and
76 directories created by mysqld will be owned by this user. You must
77 be root to use this option. By default, mysqld runs using your
78 current login name and files and directories that it creates will
79 be owned by you.
80
81 · --verbose
82
83 Verbose mode. Print more information about what the program does.
84
85 · --windows
86
87 For internal use. This option is used for creating Windows
88 distributions.
89
91 Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
92
93 This documentation is free software; you can redistribute it and/or
94 modify it only under the terms of the GNU General Public License as
95 published by the Free Software Foundation; version 2 of the License.
96
97 This documentation is distributed in the hope that it will be useful,
98 but WITHOUT ANY WARRANTY; without even the implied warranty of
99 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
100 General Public License for more details.
101
102 You should have received a copy of the GNU General Public License along
103 with the program; if not, write to the Free Software Foundation, Inc.,
104 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see
105 http://www.gnu.org/licenses/.
106
107
109 For more information, please refer to the MySQL Reference Manual, which
110 may already be installed locally and which is also available online at
111 http://dev.mysql.com/doc/.
112
114 Sun Microsystems, Inc. (http://www.mysql.com/).
115
116
117
118 MYSQL_INSTALL_DB()