source: server/databases/mysql.xml@ cc2e31b6

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since cc2e31b6 was cc2e31b6, checked in by Bruce Dubbs <bdubbs@…>, 12 years ago

Update to mysql-5.5.25a

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@10462 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 13.6 KB
Line 
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 "0841fbc79872c5f467d8c8842f45257a">
10 <!ENTITY mysql-size "24 MB">
11 <!ENTITY mysql-buildsize "930 MB (additional 170 MB to run the test suite)">
12 <!ENTITY mysql-time "4.4 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 &lfs71_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 patch: <ulink
70 url="&patch-root;/mysql-&mysql-version;-embedded-library-shared-1.patch"/></para>
71 </listitem>
72 <listitem>
73 <para>Optional Documentation (see tip below):
74 <ulink url="http://dev.mysql.com/doc/"/>
75 </para>
76 </listitem>
77 </itemizedlist>
78
79 <note><para>The patch is required only if you plan to install <application>
80 Amarok</application>.</para></note>
81
82 <bridgehead renderas="sect3">MySQL Dependencies</bridgehead>
83
84 <bridgehead renderas="sect4">Required</bridgehead>
85 <para role="optional"><xref linkend="cmake"/></para>
86
87 <bridgehead renderas="sect4">Recommended</bridgehead>
88 <para role="optional"><xref linkend="openssl"/></para>
89
90 <bridgehead renderas="sect4">Optional</bridgehead>
91 <para role="optional"><xref linkend="tcpwrappers"/> and
92 <ulink url="http://packages.debian.org/squeeze/libaio-dev">libaio</ulink></para>
93
94 <para condition="html" role="usernotes">User Notes:
95 <ulink url="&blfs-wiki;/mysql"/></para>
96
97 </sect2>
98
99 <sect2 role="installation">
100 <title>Installation of MySQL</title>
101
102 <para>For security reasons, running the server as an unprivileged user
103 and group is strongly encouraged:</para>
104
105<screen role="root"><userinput>groupadd -g 40 mysql &amp;&amp;
106useradd -c "MySQL Server" -d /dev/null -g mysql -s /bin/false -u 40 mysql</userinput></screen>
107
108 <note><para>There are a great many options available to
109 <userinput>cmake</userinput>. Check the output of the `<userinput>cmake .
110 -LH</userinput>` for additional customization options. See the <ulink
111 url="http://dev.mysql.com/doc/refman/5.5/en/source-configuration-options.html">MySQL
112 Documentation</ulink> for a full listing of all options.</para></note>
113
114 <note><para>If you plan to install <application>Amarok</application>, you need to
115 apply the optional patch, add the cmake option
116 <userinput>-DWITH_EMBEDDED_SERVER=ON</userinput> and add
117 <userinput>Embedded</userinput> to the <userinput>SEGMENTS</userinput> variable
118 below.</para></note>
119
120 <para>Apply the optional patch:</para>
121
122 <screen><userinput>patch -Np1 -i ../mysql-&mysql-version;-embedded-library-shared-1.patch</userinput></screen>
123
124 <para>Build and install <application>MySQL</application> by
125 running the following commands:</para>
126
127<screen><userinput> mkdir build &amp;&amp; \
128cd build &amp;&amp; \
129cmake .. \
130 -DSYSCONFDIR=/etc \
131 -DMYSQL_DATADIR=/srv/mysql \
132 -DINSTALL_MYSQLDATADIR=/srv/mysql \
133 -DCMAKE_INSTALL_PREFIX=/usr \
134 -DINSTALL_BINDIR=bin \
135 -DINSTALL_SBINDIR=sbin \
136 -DINSTALL_DOCDIR=share/doc/mysql \
137 -DINSTALL_DOCREADMEDIR=share/doc/mysql \
138 -DINSTALL_INCLUDEDIR=include/mysql \
139 -DINSTALL_INFODIR=share/info \
140 -DINSTALL_LIBDIR=lib \
141 -DINSTALL_MANDIR=share/man \
142 -DINSTALL_MYSQLSHAREDIR=share/mysql \
143 -DINSTALL_MYSQLTESTDIR=share/mysql-test \
144 -DINSTALL_PLUGINDIR=lib/plugin \
145 -DINSTALL_SCRIPTDIR=bin \
146 -DINSTALL_SHAREDIR=share/mysql \
147 -DINSTALL_SQLBENCHDIR=share/mysql-bench \
148 -DINSTALL_SUPPORTFILESDIR=share/mysql/support-files \
149 -DWITH_ZLIB=system \
150 -DWITH_SSL=system \
151 -DWITH_READLINE=system \
152 -DMYSQL_UNIX_ADDR=/var/run/mysql/mysql.sock \
153 -DWITH_ARCHIVE_STORAGE_ENGINE=1 \
154 -DWITH_FEDERATED_STORAGE_ENGINE=1 \
155 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
156 -DMYSQL_MAINTAINER_MODE=OFF \
157 -DWITH_DEBUG=OFF &amp;&amp;
158
159make</userinput></screen>
160
161 <para>To test the results, issue: <command>make test-force 2>&amp;1 | tee
162 test.log</command>. This forces the test to run to completion and logs all
163 the test output. There will be many tests that are not run due to
164 configuration options and developer considerations. Note that if you use
165 TCP Wrappers and have a restrictive <filename>/etc/hosts.deny</filename>
166 file, you will need to add an appropriate entry to the
167 <filename>/etc/hosts.allow</filename> file for the
168 <command>mysqld</command> daemon. Otherwise many of the tests will
169 fail. Also, two tests will fail if ipv6 is not available in the kernel
170 either as a module or built in.</para>
171
172 <note><para>The ssl tests may fail due to expired certifictes.</para></note>
173
174 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
175
176<screen role="root"><userinput>SEGMENTS="Client Server IniFiles ManPages SharedLibraries"
177SEGMENTS="$SEGMENTS Development Documentation Info Readme"
178
179for segment in $SEGMENTS; do
180 cmake -DCMAKE_INSTALL_COMPONENT=$segment -P cmake_install.cmake
181done
182
183unset SEGMENTS</userinput></screen>
184
185 <tip>
186 <para>The only documentation shipped in the source tarball are
187 <filename>mysql.info</filename> and man pages. You can download various
188 formats of the <application>MySQL</application> Reference Manual
189 from <ulink url="http://dev.mysql.com/doc/"/>.</para>
190 </tip>
191
192 <note><para>If you only want to build and install the
193 <command>mysql</command> client, use:</para>
194
195 <screen><userinput>cmake . &amp;&amp;
196make mysqlclient libmysql</userinput></screen>
197
198 <para>Continue as root:</para>
199
200 <screen role="root"><userinput>make install</userinput></screen>
201 </note>
202
203 </sect2>
204
205 <sect2 role="commands">
206 <title>Command Explanations</title>
207
208 <para><command>cmake -DCMAKE_INSTALL_COMPONENT=$segment ...</command>: This
209 command installs the appropriate portion of the package. Different
210 segemnts may be added or deleted as desired. Valid segments are listed
211 with `<command>make list_install_components</command>`. Note that the
212 'DataFiles' install segment does not honor the -DMYSQL_DATADIR or
213 -DINSTALL_MYSQLDATADIR statements.</para>
214
215 </sect2>
216
217 <sect2 role="configuration">
218 <title>Configuring MySQL</title>
219
220 <sect3 id="mysql-config">
221 <title>Config Files</title>
222
223 <para><filename>/etc/my.cnf</filename> and
224 <filename>~/.my.cnf</filename></para>
225
226 <indexterm zone="mysql mysql-config">
227 <primary sortas="e-AA.my.cnf">~/.my.cnf</primary>
228 </indexterm>
229
230 <indexterm zone="mysql mysql-config">
231 <primary sortas="e-etc-my.cnf">/etc/my.cnf</primary>
232 </indexterm>
233
234 </sect3>
235
236 <sect3>
237 <title>Configuration Information</title>
238
239 <para>There are several default configuration files available in
240 <filename class="directory">/usr/share/mysql</filename> which you can
241 use. When creating the file, ensure binary logs are disabled unless you
242 are doing database replication. Create <filename>/etc/my.cnf</filename>
243 using the following commands as the <systemitem
244 class="username">root</systemitem> user:</para>
245
246<screen role="root"><userinput>install -v -m644 /usr/share/mysql/support-files/my-medium.cnf /etc/my.cnf
247sed -i 's/^log-bin/#log-bin/' /etc/my.cnf</userinput></screen>
248
249 <para>You can now install a database and change the ownership to the
250 unprivileged user and group (perform as the <systemitem
251 class="username">root</systemitem> user):</para>
252
253<screen role="root"><userinput>mysql_install_db --basedir=/usr --datadir=/srv/mysql --user=mysql &amp;&amp;
254chgrp -v mysql /srv/mysql{,/test,/mysql}</userinput></screen>
255
256 <para>Further configuration requires that the
257 <application>MySQL</application> server is running. Start
258 the server using the following commands as the <systemitem
259 class="username">root</systemitem> user:</para>
260
261<screen role="root"><userinput>install -v -m755 -o mysql -g mysql -d /var/run/mysql &amp;&amp;
262mysqld_safe --user=mysql 2&gt;&amp;1 &gt;/dev/null &amp;</userinput></screen>
263
264 <para>A default installation does not set up a password for the
265 administrator, so use the following command as the <systemitem
266 class="username">root</systemitem> user to set one. Replace
267 <replaceable>&lt;new-password&gt;</replaceable> with your own.</para>
268
269<screen role="root"><userinput>mysqladmin -u root password <replaceable>&lt;new-password&gt;</replaceable></userinput></screen>
270
271 <para>Configuration of the server is now finished. Shut the server
272 down using the following command as the <systemitem
273 class="username">root</systemitem> user:</para>
274
275<screen role="root"><userinput>mysqladmin -p shutdown</userinput></screen>
276
277 </sect3>
278
279 <sect3 id="mysql-init">
280 <title>Boot Script</title>
281
282 <para>Install the <filename>/etc/rc.d/init.d/mysql</filename> init script
283 included in the <xref linkend="bootscripts"/> package as
284 the <systemitem class="username">root</systemitem> user to start the
285 <application>MySQL</application> server during system boot-up.</para>
286
287 <indexterm zone="mysql mysql-init">
288 <primary sortas="f-mysql">mysql</primary>
289 </indexterm>
290
291<screen role="root"><userinput>make install-mysql</userinput></screen>
292
293 </sect3>
294
295 </sect2>
296
297 <sect2 role="content">
298 <title>Contents</title>
299
300 <segmentedlist>
301 <segtitle>Installed Programs</segtitle>
302 <segtitle>Installed Libraries</segtitle>
303 <segtitle>Installed Directories</segtitle>
304
305 <seglistitem>
306 <seg>comp_err, innochecksum, msql2mysql, my_print_defaults,
307 myisam_ftdump, myisamchk, myisamlog, myisampack, mysql,
308 mysql_client_test, mysql_config, mysql_convert_table_format,
309 mysql_create_system_tables, mysql_explain_log, mysql_find_rows,
310 mysql_fix_extensions, mysql_fix_privilege_tables, mysql_install_db,
311 mysql_secure_installation, mysql_setpermission, mysql_tableinfo,
312 mysql_tzinfo_to_sql, mysql_waitpid, mysql_zap, mysqlaccess, mysqladmin,
313 mysqlbinlog, mysqlbug, mysqlcheck, mysqld, mysqld_multi, mysqld_safe,
314 mysqldump, mysqldumpslow, mysqlhotcopy, mysqlimport, mysqlmanager,
315 mysqlshow, mysqltest, mysqltestmanager, mysqltestmanager-pwgen,
316 mysqltestmanagerc, perror, replace, resolve_stack_dump, and
317 resolveip</seg>
318 <seg>libdbug.a, libheap.a, libmyisam.a, libmyisammrg.a,
319 libmysqlclient.{so,a}, libmysqlclient_r.{so,a}, libmystrings.a,
320 libmysys.a, and libvio.a</seg>
321 <seg>/srv/mysql, /usr/include/mysql, /usr/lib/plugin, /usr/share/mysql and
322 /var/run/mysql</seg>
323 </seglistitem>
324 </segmentedlist>
325
326 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
327
328 <para>Descriptions of all the programs and libraries would be several
329 pages long. Instead, consult the <filename>mysql.info</filename>
330 documentation or the on-line reference manual at <ulink
331 url="http://dev.mysql.com/doc/refman/5.1/en/index.html"/>.</para>
332
333 <para>The <application>Perl</application> DBI modules must be installed
334 for some of the <application>MySQL</application> support programs to
335 function properly.</para>
336
337 </sect2>
338
339</sect1>
Note: See TracBrowser for help on using the repository browser.