source: server/databases/mysql.xml@ 6e1616e2

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 6e1616e2 was 0d7900a, checked in by Randy McMurchy <randy@…>, 11 years ago

Removed extraneous spaces from blank lines and at the end of lines in the .xml

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

  • Property mode set to 100644
File size: 14.2 KB
RevLine 
[08254fc]1<?xml version="1.0" encoding="ISO-8859-1"?>
[6732c094]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[08254fc]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
[68196987]6
[3ea5512]7 <!ENTITY mysql-download-http "http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-&mysql-version;.tar.gz">
[e3fec8f]8 <!ENTITY mysql-download-ftp " ">
[cd34755]9 <!ENTITY mysql-md5sum "e6b9f9cb82e990bd8f0474df7462904e">
[cc2e31b6]10 <!ENTITY mysql-size "24 MB">
[cd34755]11 <!ENTITY mysql-buildsize "760 MB (additional 170 MB to run the test suite)">
[85c61ee]12 <!ENTITY mysql-time "4.0 SBU (Test suite is an additional 45 minutes, only partially CPU dependent)">
[08254fc]13]>
14
[c30b739]15<sect1 id="mysql" xreflabel="MySQL-&mysql-version;">
[22c7fe6]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
[cd34755]32 <para>
33 <application>MySQL</application> is a widely used and fast SQL database
34 server. It is a client/server implementation that consists of a
35 server daemon and many different client programs and libraries.
36 </para>
[22c7fe6]37
[9697f0f]38 &lfs72_checked;
[fa050c09]39
[22c7fe6]40 <bridgehead renderas="sect3">Package Information</bridgehead>
41 <itemizedlist spacing="compact">
42 <listitem>
[cd34755]43 <para>
44 Download (HTTP): <ulink url="&mysql-download-http;"/>
45 </para>
[22c7fe6]46 </listitem>
47 <listitem>
[cd34755]48 <para>
49 Download (FTP): <ulink url="&mysql-download-ftp;"/>
50 </para>
[22c7fe6]51 </listitem>
52 <listitem>
[cd34755]53 <para>
54 Download MD5 sum: &mysql-md5sum;
55 </para>
[22c7fe6]56 </listitem>
57 <listitem>
[cd34755]58 <para>
59 Download size: &mysql-size;
60 </para>
[22c7fe6]61 </listitem>
62 <listitem>
[cd34755]63 <para>
64 Estimated disk space required: &mysql-buildsize;
65 </para>
[22c7fe6]66 </listitem>
67 <listitem>
[cd34755]68 <para>
69 Estimated build time: &mysql-time;
70 </para>
[22c7fe6]71 </listitem>
72 </itemizedlist>
73
[47a345a2]74 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
[9c98f0e]75 <itemizedlist spacing="compact">
[7ea2a6f]76 <listitem>
[cd34755]77 <para>
78 Optional patch (recommended if building for Amarok):
79 <ulink url="&patch-root;/mysql-&mysql-version;-embedded_library_shared-1.patch"/>
80 </para>
[7ea2a6f]81 </listitem>
[47a345a2]82 <listitem>
[cd34755]83 <para>
84 Optional Documentation (see tip below):
[47a345a2]85 <ulink url="http://dev.mysql.com/doc/"/>
[f267149]86 </para>
[9c98f0e]87 </listitem>
88 </itemizedlist>
[0d7900a]89
[1e11f8e]90 <bridgehead renderas="sect3">MySQL Dependencies</bridgehead>
[22c7fe6]91
[16e74d3]92 <bridgehead renderas="sect4">Required</bridgehead>
[cd34755]93 <para role="required">
94 <xref linkend="cmake"/>
95 </para>
[16e74d3]96
[f267149]97 <bridgehead renderas="sect4">Recommended</bridgehead>
[cd34755]98 <para role="recommended">
99 <xref linkend="openssl"/>
100 </para>
[f267149]101
[22c7fe6]102 <bridgehead renderas="sect4">Optional</bridgehead>
[bc6e56d]103 <para role="optional">
104 <ulink url="http://packages.debian.org/source/sid/libaio">libaio</ulink>
105 </para>
[9f12e36]106
[3cb0c57]107 <para condition="html" role="usernotes">User Notes:
[cd34755]108 <ulink url="&blfs-wiki;/mysql"/>
109 </para>
[22c7fe6]110 </sect2>
[0d7900a]111
[22c7fe6]112 <sect2 role="installation">
113 <title>Installation of MySQL</title>
[0d7900a]114
[cd34755]115 <para>
116 For security reasons, running the server as an unprivileged user
117 and group is strongly encouraged. Issue the following (as
118 <systemitem class="username">root</systemitem>) to create the
119 user and group:
120 </para>
[22c7fe6]121
[b785ab29]122<screen role="root"><userinput>groupadd -g 40 mysql &amp;&amp;
[cd34755]123useradd -c "MySQL Server" -d /srv/mysql -g mysql -s /bin/false -u 40 mysql</userinput></screen>
124
125 <para>
126 If the MySQL server is not needed, it is possible to build only the
127 client libraries of MySQL. To do this you need to add
128 <parameter>-DWITHOUT_SERVER=ON</parameter> to the <command>cmake</command>
129 command below.
130 </para>
131
132 <para>
133 MySQL contains an embedded server library which can be enabled with
134 the cmake option <parameter>-DWITH_EMBEDDED_SERVER=ON</parameter>. By
135 default this server is built as a statically linked library,
136 <filename>libmysqld.a</filename>, but by applying the optional patch, a
137 shared version of this library can be built. The library is needed
138 by certain applications, such as <application>Amarok</application> and
139 we recommend use of the shared libraries.
140 </para>
[0d7900a]141
[cd34755]142 <para>
143 There are numerous options available to
144 <userinput>cmake</userinput>. Check the output of the `<userinput>cmake .
145 -LH</userinput>` for additional customization options. See the <ulink
146 url="http://dev.mysql.com/doc/refman/5.5/en/source-configuration-options.html">MySQL
147 Documentation</ulink> for a full listing of all options.
148 </para>
[0d7900a]149
[cd34755]150 <para>
151 If you want to build shared version of the embedded server library, apply
152 the following patch:
153 </para>
[0d7900a]154
[e3fec8f]155<screen><userinput>patch -Np1 -i ../mysql-&mysql-version;-embedded_library_shared-1.patch</userinput></screen>
[0d7900a]156
[cd34755]157 <para>
158 Install <application>MySQL</application> by running the
159 following commands:
160 </para>
[0d7900a]161
[cd34755]162<screen><userinput>sed -i "/ADD_SUBDIRECTORY(sql\/share)/d" CMakeLists.txt &amp;&amp;
163sed -i "s/ADD_SUBDIRECTORY(libmysql)/&amp;\\nADD_SUBDIRECTORY(sql\/share)/" CMakeLists.txt &amp;&amp;
164sed -i "s@data/test@\${INSTALL_MYSQLSHAREDIR}@g" sql/CMakeLists.txt &amp;&amp;
165sed -i "s@data/mysql@\${INSTALL_MYSQLTESTDIR}@g" sql/CMakeLists.txt &amp;&amp;
166mkdir build &amp;&amp;
[dc2b407]167cd build &amp;&amp;
[cd34755]168cmake -DCMAKE_BUILD_TYPE=Release \
169 -DCMAKE_INSTALL_PREFIX=/usr \
[e3fec8f]170 -DINSTALL_DOCDIR=share/doc/mysql \
171 -DINSTALL_DOCREADMEDIR=share/doc/mysql \
172 -DINSTALL_INCLUDEDIR=include/mysql \
173 -DINSTALL_INFODIR=share/info \
174 -DINSTALL_MANDIR=share/man \
175 -DINSTALL_MYSQLDATADIR=/srv/mysql \
176 -DINSTALL_MYSQLSHAREDIR=share/mysql \
177 -DINSTALL_MYSQLTESTDIR=share/mysql/test \
178 -DINSTALL_PLUGINDIR=lib/mysql \
179 -DINSTALL_SBINDIR=sbin \
180 -DINSTALL_SCRIPTDIR=bin \
181 -DINSTALL_SQLBENCHDIR=share/mysql/bench \
182 -DINSTALL_SUPPORTFILESDIR=share/mysql/support \
183 -DMYSQL_DATADIR=/srv/mysql \
184 -DMYSQL_UNIX_ADDR=/var/run/mysql/mysql.sock \
[cd34755]185 -DSYSCONFDIR=/etc/mysql \
[e3fec8f]186 -DWITH_PARTITION_STORAGE_ENGINE=OFF \
187 -DWITH_PERFSCHEMA_STORAGE_ENGINE=OFF \
188 -DWITH_READLINE=system \
189 -DWITH_SSL=system \
190 .. &amp;&amp;
[9c98f0e]191make</userinput></screen>
[68196987]192
[cd34755]193 <para>
194 To test the results, issue: <command>make test-force 2>&amp;1 | tee
195 test.log</command>. This forces the test to run to completion and logs all
196 the test output. There will be many tests that are not run due to
197 configuration options and developer considerations. Otherwise many of the
198 tests will fail. Also, two tests will fail if ipv6 is not available in
199 the kernel either as a module or built in.
200 </para>
[867e611]201
[cd34755]202 <note>
203 <para>
204 The SSL tests may fail due to expired certificates.
205 </para>
206 </note>
[0d7900a]207
[cd34755]208 <para>
209 Now, as the <systemitem class="username">root</systemitem> user:
210 </para>
[e3fec8f]211
[cd34755]212<screen role="root"><userinput>make install</userinput></screen>
[e3fec8f]213
[cd34755]214 <tip>
215 <para>
216 The only documentation shipped in the source tarball are
217 <filename>mysql.info</filename> and man pages. You can download
218 various formats of the <application>MySQL</application>
219 Reference Manual from <ulink url="http://dev.mysql.com/doc/"/>.
220 </para>
221 </tip>
[9b603d4]222
[16e74d3]223 </sect2>
[08254fc]224
[16e74d3]225 <sect2 role="commands">
226 <title>Command Explanations</title>
[9dfd852b]227
[cd34755]228 <para>
229 <command>sed -i ...</command>: First two seds fix client-only builds. Last
230 two seds set correct installation directories for some components.
231 </para>
[e3fec8f]232
[cd34755]233 <para>
234 <parameter>-DWITH_&lt;engine&gt;_STORAGE_ENGINE=ON</parameter>: The default
235 instructions only build the innobase (InnoDB) storage engine. If other
236 storage engines are desired use this switch to enable them. Valid choices
237 are ARCHIVE, BLACKHOLE, EXAMPLE, FEDERATED, INNOBASE, NDBCLUSTER,
238 PARTITION and PERFSCHEMA.
239 </para>
[e3fec8f]240
[cd34755]241 <para>
242 <parameter>-DWITHOUT_SERVER=ON</parameter>: Use this switch if you don't
243 want the server and would like to build the client only.
244 </para>
[e3fec8f]245
[cd34755]246 <para>
247 <parameter>-DWITH_EMBEDDED_SERVER=ON</parameter>: Use this switch to build
248 the embedded server library.
249 </para>
[0d7900a]250
[cd34755]251 <para>
252 <parameter>-DWITH_SSL=system</parameter>: This switch is used to tell the
253 build system to use system version of the
254 <application>OpenSSL</application>. Remove it if you didn't install
255 <application>OpenSSL</application>.
256 </para>
[9ad2f59]257
[22c7fe6]258 </sect2>
[08254fc]259
[22c7fe6]260 <sect2 role="configuration">
261 <title>Configuring MySQL</title>
[08254fc]262
[22c7fe6]263 <sect3 id="mysql-config">
264 <title>Config Files</title>
[08254fc]265
[cd34755]266 <para>
267 <filename>/etc/mysql/my.cnf</filename> and
268 <filename>~/.my.cnf</filename>
269 </para>
[08254fc]270
[22c7fe6]271 <indexterm zone="mysql mysql-config">
272 <primary sortas="e-AA.my.cnf">~/.my.cnf</primary>
273 </indexterm>
[08254fc]274
[22c7fe6]275 <indexterm zone="mysql mysql-config">
[cd34755]276 <primary sortas="e-etc-mysql-my.cnf">/etc/mysql/my.cnf</primary>
[22c7fe6]277 </indexterm>
[08254fc]278
[22c7fe6]279 </sect3>
[08254fc]280
[22c7fe6]281 <sect3>
282 <title>Configuration Information</title>
[08254fc]283
[cd34755]284 <para>
285 There are several default configuration files available in
286 <filename class="directory">/usr/share/mysql</filename> which you can
287 use. When creating the file, ensure binary logs are disabled unless you
288 are doing database replication. Create <filename>/etc/mysql/my.cnf</filename>
289 using the following commands as the <systemitem
290 class="username">root</systemitem> user:
291 </para>
292
293<screen role="root"><userinput>install -v -Dm644 /usr/share/mysql/support/my-medium.cnf /etc/mysql/my.cnf &amp;&amp;
294sed -i 's/^log-bin/#log-bin/' /etc/mysql/my.cnf &amp;&amp;
295sed -i 's/^binlog/#binlog/' /etc/mysql/my.cnf</userinput></screen>
296
297 <para>
298 You can now install a database and change the ownership to the
299 unprivileged user and group (perform as the <systemitem
300 class="username">root</systemitem> user):
301 </para>
[08254fc]302
[16e74d3]303<screen role="root"><userinput>mysql_install_db --basedir=/usr --datadir=/srv/mysql --user=mysql &amp;&amp;
[cd34755]304chown -R mysql:mysql /srv/mysql</userinput></screen>
[08254fc]305
[cd34755]306 <para>
307 Further configuration requires that the
308 <application>MySQL</application> server is running. Start
309 the server using the following commands as the <systemitem
310 class="username">root</systemitem> user:
311 </para>
[08254fc]312
[515209b3]313<screen role="root"><userinput>install -v -m755 -o mysql -g mysql -d /var/run/mysql &amp;&amp;
[22c7fe6]314mysqld_safe --user=mysql 2&gt;&amp;1 &gt;/dev/null &amp;</userinput></screen>
[08254fc]315
[cd34755]316 <para>
317 A default installation does not set up a password for the
318 administrator, so use the following command as the <systemitem
319 class="username">root</systemitem> user to set one. Replace
320 <replaceable>&lt;new-password&gt;</replaceable> with your own.
321 </para>
[08254fc]322
[3cb0c57]323<screen role="root"><userinput>mysqladmin -u root password <replaceable>&lt;new-password&gt;</replaceable></userinput></screen>
[08254fc]324
[cd34755]325 <para>
326 Configuration of the server is now finished. Shut the server
327 down using the following command as the <systemitem
328 class="username">root</systemitem> user:
329 </para>
[4b93ac2]330
[22c7fe6]331<screen role="root"><userinput>mysqladmin -p shutdown</userinput></screen>
[08254fc]332
[22c7fe6]333 </sect3>
[08254fc]334
[22c7fe6]335 <sect3 id="mysql-init">
336 <title>Boot Script</title>
[08254fc]337
[cd34755]338 <para>
339 Install the <filename>/etc/rc.d/init.d/mysql</filename> init script
340 included in the <xref linkend="bootscripts"/> package as
341 the <systemitem class="username">root</systemitem> user to start the
342 <application>MySQL</application> server during system boot-up.
343 </para>
[08254fc]344
[22c7fe6]345 <indexterm zone="mysql mysql-init">
346 <primary sortas="f-mysql">mysql</primary>
347 </indexterm>
[20f5e71a]348
[22c7fe6]349<screen role="root"><userinput>make install-mysql</userinput></screen>
[20f5e71a]350
[22c7fe6]351 </sect3>
[08254fc]352
[22c7fe6]353 </sect2>
[08254fc]354
[22c7fe6]355 <sect2 role="content">
356 <title>Contents</title>
357
358 <segmentedlist>
359 <segtitle>Installed Programs</segtitle>
360 <segtitle>Installed Libraries</segtitle>
361 <segtitle>Installed Directories</segtitle>
362
363 <seglistitem>
[cd34755]364 <seg>
365 innochecksum, msql2mysql, myisamchk, myisam_ftdump, myisamlog,
366 myisampack, my_print_defaults, mysql, mysqlaccess, mysqlaccess.conf,
367 mysqladmin, mysqlbinlog, mysqlbug, mysqlcheck, mysql_client_test,
368 mysql_client_test_embedded, mysql_config, mysql_convert_table_format,
369 mysqld, mysqld_multi, mysqld_safe, mysqldump, mysqldumpslow,
370 mysql_embedded, mysql_find_rows, mysql_fix_extensions, mysqlhotcopy,
371 mysqlimport, mysql_install_db, mysql_plugin, mysql_secure_installation,
372 mysql_setpermission, mysqlshow, mysqlslap, mysqltest,
373 mysqltest_embedded, mysql_tzinfo_to_sql, mysql_upgrade, mysql_waitpid,
374 mysql_zap, perror, replace, resolveip and resolve_stack_dump
375 </seg>
376 <seg>
377 libmysqlclient.{so,a}, libmysqlclient_r.{so,a}, libmysqld.{so,a},
378 libmysqlservices.a and several in /usr/lib/mysql
379 </seg>
380 <seg>
381 /etc/mysql,
382 /srv/mysql,
383 /usr/include/mysql,
384 /usr/lib/mysql,
385 /usr/share/doc/mysql and
386 /usr/share/mysql
387 </seg>
[22c7fe6]388 </seglistitem>
389 </segmentedlist>
390
391 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
392
[cd34755]393 <para>
394 Descriptions of all the programs and libraries would be several
395 pages long. Instead, consult the <filename>mysql.info</filename>
396 documentation or the on-line reference manual at <ulink
397 url="http://dev.mysql.com/doc/refman/5.5/en/index.html"/>.
398 </para>
[22c7fe6]399
[cd34755]400 <para>
401 The <application>Perl</application> DBI modules must be installed
402 for some of the <application>MySQL</application> support programs to
403 function properly.
404 </para>
[22c7fe6]405
406 </sect2>
[f45b1953]407
408</sect1>
Note: See TracBrowser for help on using the repository browser.