1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY mysql-download-http "&sources-anduin-http;/m/mysql-&mysql-version;.tar.gz">
|
---|
8 | <!ENTITY mysql-download-ftp "&sources-anduin-ftp;/m/mysql-&mysql-version;.tar.gz">
|
---|
9 | <!ENTITY mysql-md5sum "dcb6a06e68c5e8f30f57b15300730c9c">
|
---|
10 | <!ENTITY mysql-size "23 MB">
|
---|
11 | <!ENTITY mysql-buildsize "883 MB (additional 170 MB to run the test suite)">
|
---|
12 | <!ENTITY mysql-time "3.9 SBU (Test suite is an additional 45 minutes, only partially CPU dependent)">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="mysql" xreflabel="MySQL-&mysql-version;">
|
---|
16 | <?dbhtml filename="mysql.html"?>
|
---|
17 |
|
---|
18 | <sect1info>
|
---|
19 | <othername>$LastChangedBy$</othername>
|
---|
20 | <date>$Date$</date>
|
---|
21 | </sect1info>
|
---|
22 |
|
---|
23 | <title>MySQL-&mysql-version;</title>
|
---|
24 |
|
---|
25 | <indexterm zone="mysql">
|
---|
26 | <primary sortas="a-MySQL">MySQL</primary>
|
---|
27 | </indexterm>
|
---|
28 |
|
---|
29 | <sect2 role="package">
|
---|
30 | <title>Introduction to MySQL</title>
|
---|
31 |
|
---|
32 | <para><application>MySQL</application> is a widely used and fast SQL
|
---|
33 | database server. It is a client/server implementation that consists of a
|
---|
34 | server daemon and many different client programs and libraries.</para>
|
---|
35 |
|
---|
36 | <para>There may be a more recent release available from the
|
---|
37 | <application>MySQL</application> home page. You can check
|
---|
38 | <ulink url="http://dev.mysql.com/"/> and probably use the
|
---|
39 | existing BLFS instructions. Note that versions other than the one shown
|
---|
40 | in the download URLs have not been tested in a BLFS environment.</para>
|
---|
41 |
|
---|
42 | &lfs70_checked;
|
---|
43 |
|
---|
44 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
45 | <itemizedlist spacing="compact">
|
---|
46 | <listitem>
|
---|
47 | <para>Download (HTTP): <ulink url="&mysql-download-http;"/></para>
|
---|
48 | </listitem>
|
---|
49 | <listitem>
|
---|
50 | <para>Download (FTP): <ulink url="&mysql-download-ftp;"/></para>
|
---|
51 | </listitem>
|
---|
52 | <listitem>
|
---|
53 | <para>Download MD5 sum: &mysql-md5sum;</para>
|
---|
54 | </listitem>
|
---|
55 | <listitem>
|
---|
56 | <para>Download size: &mysql-size;</para>
|
---|
57 | </listitem>
|
---|
58 | <listitem>
|
---|
59 | <para>Estimated disk space required: &mysql-buildsize;</para>
|
---|
60 | </listitem>
|
---|
61 | <listitem>
|
---|
62 | <para>Estimated build time: &mysql-time;</para>
|
---|
63 | </listitem>
|
---|
64 | </itemizedlist>
|
---|
65 |
|
---|
66 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
67 | <itemizedlist spacing="compact">
|
---|
68 | <listitem>
|
---|
69 | <para>Optional Documentation (see tip below):
|
---|
70 | <ulink url="http://dev.mysql.com/doc/"/>
|
---|
71 | </para>
|
---|
72 | </listitem>
|
---|
73 | </itemizedlist>
|
---|
74 |
|
---|
75 | <bridgehead renderas="sect3">MySQL Dependencies</bridgehead>
|
---|
76 |
|
---|
77 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
78 | <para role="optional"><xref linkend="cmake"/></para>
|
---|
79 |
|
---|
80 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
81 | <para role="optional"><xref linkend="openssl"/></para>
|
---|
82 |
|
---|
83 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
84 | <para role="optional"><xref linkend="tcpwrappers"/>,
|
---|
85 | <ulink url="http://packages.debian.org/squeeze/libaio-dev">libaio</ulink></para>
|
---|
86 |
|
---|
87 | <para condition="html" role="usernotes">User Notes:
|
---|
88 | <ulink url="&blfs-wiki;/mysql"/></para>
|
---|
89 |
|
---|
90 | </sect2>
|
---|
91 |
|
---|
92 | <sect2 role="installation">
|
---|
93 | <title>Installation of MySQL</title>
|
---|
94 |
|
---|
95 | <para>For security reasons, running the server as an unprivileged user
|
---|
96 | and group is strongly encouraged:</para>
|
---|
97 |
|
---|
98 | <screen role="root"><userinput>groupadd -g 40 mysql &&
|
---|
99 | useradd -c "MySQL Server" -d /dev/null -g mysql -s /bin/false -u 40 mysql</userinput></screen>
|
---|
100 |
|
---|
101 | <note><para>There are a great many options available to
|
---|
102 | <userinput>cmake</userinput>. Check the output of the `<userinput>cmake .
|
---|
103 | -LH</userinput>` for additional customization options. See ithe <ulink
|
---|
104 | url="http://dev.mysql.com/doc/refman/5.5/en/source-configuration-options.html">MySQL
|
---|
105 | Documentation</ulink> for a full listing of all options.</para></note>
|
---|
106 |
|
---|
107 | <para>Build and install <application>MySQL</application> by
|
---|
108 | running the following commands:</para>
|
---|
109 |
|
---|
110 | <screen><userinput>cmake . \
|
---|
111 | -DSYSCONFDIR=/etc \
|
---|
112 | -DMYSQL_DATADIR=/srv/mysql \
|
---|
113 | -DINSTALL_MYSQLDATADIR=/srv/mysql \
|
---|
114 | -DCMAKE_INSTALL_PREFIX=/usr \
|
---|
115 | -DINSTALL_BINDIR=bin \
|
---|
116 | -DINSTALL_SBINDIR=sbin \
|
---|
117 | -DINSTALL_DOCDIR=share/doc/mysql \
|
---|
118 | -DINSTALL_DOCREADMEDIR=share/doc/mysql \
|
---|
119 | -DINSTALL_INCLUDEDIR=include/mysql \
|
---|
120 | -DINSTALL_INFODIR=share/info \
|
---|
121 | -DINSTALL_LIBDIR=lib \
|
---|
122 | -DINSTALL_MANDIR=share/man \
|
---|
123 | -DINSTALL_MYSQLSHAREDIR=share/mysql \
|
---|
124 | -DINSTALL_MYSQLTESTDIR=share/mysql-test \
|
---|
125 | -DINSTALL_PLUGINDIR=lib/plugin \
|
---|
126 | -DINSTALL_SCRIPTDIR=bin \
|
---|
127 | -DINSTALL_SHAREDIR=share/mysql \
|
---|
128 | -DINSTALL_SQLBENCHDIR=share/mysql-bench \
|
---|
129 | -DINSTALL_SUPPORTFILESDIR=share/mysql/support-files \
|
---|
130 | -DWITH_ZLIB=system \
|
---|
131 | -DWITH_SSL=system \
|
---|
132 | -DWITH_READLINE=system \
|
---|
133 | -DMYSQL_UNIX_ADDR=/var/run/mysql/mysql.sock \
|
---|
134 | -DWITH_ARCHIVE_STORAGE_ENGINE=1 \
|
---|
135 | -DWITH_FEDERATED_STORAGE_ENGINE=1 \
|
---|
136 | -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
|
---|
137 | -DMYSQL_MAINTAINER_MODE=OFF \
|
---|
138 | -DWITH_DEBUG=OFF &&
|
---|
139 | make</userinput></screen>
|
---|
140 |
|
---|
141 | <para>To test the results, issue: <command>make test-force 2>&1 | tee
|
---|
142 | test.log</command>. This forces the test to run to completion and logs all
|
---|
143 | the test output. There will be many tests that are not run due to
|
---|
144 | configuration options and developer considerations. Note that if you use
|
---|
145 | TCP Wrappers and have a restrictive <filename>/etc/hosts.deny</filename>
|
---|
146 | file, you will need to add an appropriate entry to the
|
---|
147 | <filename>/etc/hosts.allow</filename> file for the
|
---|
148 | <command>mysqld</command> daemon. Otherwise many of the tests will
|
---|
149 | fail.</para>
|
---|
150 |
|
---|
151 | <note><para>The ssl tests may fail due to expired certifictes.</para></note>
|
---|
152 |
|
---|
153 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
154 |
|
---|
155 | <screen role="root"><userinput>SEGMENTS="Client Server IniFiles ManPages"
|
---|
156 | SEGMENTS="$SEGMENTS Development Documentation Info Readme"
|
---|
157 |
|
---|
158 | for segment in $SEGMENTS; do
|
---|
159 | cmake -DCMAKE_INSTALL_COMPONENT=$segment -P cmake_install.cmake
|
---|
160 | done
|
---|
161 |
|
---|
162 | unset SEGMENTS</userinput></screen>
|
---|
163 |
|
---|
164 | <tip>
|
---|
165 | <para>The only documentation shipped in the source tarball are
|
---|
166 | <filename>mysql.info</filename> and man pages. You can download various
|
---|
167 | formats of the <application>MySQL</application> Reference Manual
|
---|
168 | from <ulink url="http://dev.mysql.com/doc/"/>.</para>
|
---|
169 | </tip>
|
---|
170 |
|
---|
171 | <note><para>If you only want to build and install the
|
---|
172 | <command>mysql</command> client, use:</para>
|
---|
173 |
|
---|
174 | <screen><userinput>cmake . &&
|
---|
175 | make mysqlclient libmysql</userinput></screen>
|
---|
176 |
|
---|
177 | <para>Continue as root:</para>
|
---|
178 |
|
---|
179 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
180 | </note>
|
---|
181 |
|
---|
182 | </sect2>
|
---|
183 |
|
---|
184 | <sect2 role="commands">
|
---|
185 | <title>Command Explanations</title>
|
---|
186 |
|
---|
187 | <para><command>cmake -DCMAKE_INSTALL_COMPONENT=$segment ...</command>: This
|
---|
188 | command installs the appropriate portion of the package. Different
|
---|
189 | segemnts may be added or deleted as desired. Valid segments are listed
|
---|
190 | with `<command>make list_install_components</command>`. Note that the
|
---|
191 | 'DataFiles' install segment does not honor the -DMYSQL_DATADIR or
|
---|
192 | -DINSTALL_MYSQLDATADIR statements.</para>
|
---|
193 |
|
---|
194 | </sect2>
|
---|
195 |
|
---|
196 | <sect2 role="configuration">
|
---|
197 | <title>Configuring MySQL</title>
|
---|
198 |
|
---|
199 | <sect3 id="mysql-config">
|
---|
200 | <title>Config Files</title>
|
---|
201 |
|
---|
202 | <para><filename>/etc/my.cnf</filename> and
|
---|
203 | <filename>~/.my.cnf</filename></para>
|
---|
204 |
|
---|
205 | <indexterm zone="mysql mysql-config">
|
---|
206 | <primary sortas="e-AA.my.cnf">~/.my.cnf</primary>
|
---|
207 | </indexterm>
|
---|
208 |
|
---|
209 | <indexterm zone="mysql mysql-config">
|
---|
210 | <primary sortas="e-etc-my.cnf">/etc/my.cnf</primary>
|
---|
211 | </indexterm>
|
---|
212 |
|
---|
213 | </sect3>
|
---|
214 |
|
---|
215 | <sect3>
|
---|
216 | <title>Configuration Information</title>
|
---|
217 |
|
---|
218 | <para>There are several default configuration files available in
|
---|
219 | <filename class="directory">/usr/share/mysql</filename> which you can
|
---|
220 | use. Create <filename>/etc/my.cnf</filename> using the following command
|
---|
221 | as the <systemitem class="username">root</systemitem> user:</para>
|
---|
222 |
|
---|
223 | <screen role="root"><userinput>install -v -m644 /usr/share/mysql/support-files/my-medium.cnf /etc/my.cnf</userinput></screen>
|
---|
224 |
|
---|
225 | <para>You can now install a database and change the ownership to the
|
---|
226 | unprivileged user and group (perform as the <systemitem
|
---|
227 | class="username">root</systemitem> user):</para>
|
---|
228 |
|
---|
229 | <screen role="root"><userinput>mysql_install_db --basedir=/usr --datadir=/srv/mysql --user=mysql &&
|
---|
230 | chgrp -v mysql /srv/mysql{,/test,/mysql}</userinput></screen>
|
---|
231 |
|
---|
232 | <para>Further configuration requires that the
|
---|
233 | <application>MySQL</application> server is running. Start
|
---|
234 | the server using the following commands as the <systemitem
|
---|
235 | class="username">root</systemitem> user:</para>
|
---|
236 |
|
---|
237 | <screen role="root"><userinput>install -v -m755 -o mysql -g mysql -d /var/run/mysql &&
|
---|
238 | mysqld_safe --user=mysql 2>&1 >/dev/null &</userinput></screen>
|
---|
239 |
|
---|
240 | <para>A default installation does not set up a password for the
|
---|
241 | administrator, so use the following command as the <systemitem
|
---|
242 | class="username">root</systemitem> user to set one. Replace
|
---|
243 | <replaceable><new-password></replaceable> with your own.</para>
|
---|
244 |
|
---|
245 | <screen role="root"><userinput>mysqladmin -u root password <replaceable><new-password></replaceable></userinput></screen>
|
---|
246 |
|
---|
247 | <para>Configuration of the server is now finished. Shut the server
|
---|
248 | down using the following command as the <systemitem
|
---|
249 | class="username">root</systemitem> user:</para>
|
---|
250 |
|
---|
251 | <screen role="root"><userinput>mysqladmin -p shutdown</userinput></screen>
|
---|
252 |
|
---|
253 | </sect3>
|
---|
254 |
|
---|
255 | <sect3 id="mysql-init">
|
---|
256 | <title>Boot Script</title>
|
---|
257 |
|
---|
258 | <para>Install the <filename>/etc/rc.d/init.d/mysql</filename> init script
|
---|
259 | included in the <xref linkend="bootscripts"/> package as
|
---|
260 | the <systemitem class="username">root</systemitem> user to start the
|
---|
261 | <application>MySQL</application> server during system boot-up.</para>
|
---|
262 |
|
---|
263 | <indexterm zone="mysql mysql-init">
|
---|
264 | <primary sortas="f-mysql">mysql</primary>
|
---|
265 | </indexterm>
|
---|
266 |
|
---|
267 | <screen role="root"><userinput>make install-mysql</userinput></screen>
|
---|
268 |
|
---|
269 | </sect3>
|
---|
270 |
|
---|
271 | </sect2>
|
---|
272 |
|
---|
273 | <sect2 role="content">
|
---|
274 | <title>Contents</title>
|
---|
275 |
|
---|
276 | <segmentedlist>
|
---|
277 | <segtitle>Installed Programs</segtitle>
|
---|
278 | <segtitle>Installed Libraries</segtitle>
|
---|
279 | <segtitle>Installed Directories</segtitle>
|
---|
280 |
|
---|
281 | <seglistitem>
|
---|
282 | <seg>comp_err, innochecksum, msql2mysql, my_print_defaults,
|
---|
283 | myisam_ftdump, myisamchk, myisamlog, myisampack, mysql,
|
---|
284 | mysql_client_test, mysql_config, mysql_convert_table_format,
|
---|
285 | mysql_create_system_tables, mysql_explain_log, mysql_find_rows,
|
---|
286 | mysql_fix_extensions, mysql_fix_privilege_tables, mysql_install_db,
|
---|
287 | mysql_secure_installation, mysql_setpermission, mysql_tableinfo,
|
---|
288 | mysql_tzinfo_to_sql, mysql_waitpid, mysql_zap, mysqlaccess, mysqladmin,
|
---|
289 | mysqlbinlog, mysqlbug, mysqlcheck, mysqld, mysqld_multi, mysqld_safe,
|
---|
290 | mysqldump, mysqldumpslow, mysqlhotcopy, mysqlimport, mysqlmanager,
|
---|
291 | mysqlshow, mysqltest, mysqltestmanager, mysqltestmanager-pwgen,
|
---|
292 | mysqltestmanagerc, perror, replace, resolve_stack_dump, and
|
---|
293 | resolveip</seg>
|
---|
294 | <seg>libdbug.a, libheap.a, libmyisam.a, libmyisammrg.a,
|
---|
295 | libmysqlclient.{so,a}, libmysqlclient_r.{so,a}, libmystrings.a,
|
---|
296 | libmysys.a, and libvio.a</seg>
|
---|
297 | <seg>/srv/mysql, /usr/include/mysql, /usr/lib/mysql, /usr/share/mysql, and
|
---|
298 | /var/run/mysql</seg>
|
---|
299 | </seglistitem>
|
---|
300 | </segmentedlist>
|
---|
301 |
|
---|
302 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
303 |
|
---|
304 | <para>Descriptions of all the programs and libraries would be several
|
---|
305 | pages long. Instead, consult the <filename>mysql.info</filename>
|
---|
306 | documentation or the on-line reference manual at <ulink
|
---|
307 | url="http://dev.mysql.com/doc/refman/5.1/en/index.html"/>.</para>
|
---|
308 |
|
---|
309 | <para>The <application>Perl</application> DBI modules must be installed
|
---|
310 | for some of the <application>MySQL</application> support programs to
|
---|
311 | function properly.</para>
|
---|
312 |
|
---|
313 | </sect2>
|
---|
314 |
|
---|
315 | </sect1>
|
---|