source: server/databases/mysql.xml@ cb612ee6

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 12.2 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 gimp3 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/for-12.3 xry111/intltool xry111/llvm18 xry111/soup3 xry111/spidermonkey128 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since cb612ee6 was a40fc14, checked in by Ken Moffat <ken@…>, 14 years ago

fix entity typo in mysql

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

  • Property mode set to 100644
File size: 13.9 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
[d0151ee]7 <!-- <!ENTITY mysql-download-http "http://mysql.mirrors.hoobly.com/Downloads/MySQL-5.0/mysql-&mysql-version;.tar.gz">
8 <!ENTITY mysql-download-ftp "ftp://ftp.fu-berlin.de/unix/databases/mysql/Downloads/MySQL-5.0/mysql-&mysql-version;.tar.gz"> -->
9 <!ENTITY mysql-download-http "&sources-anduin-http;/m/mysql-&mysql-version;.tar.gz">
10 <!ENTITY mysql-download-ftp "&sources-anduin-ftp;/m/mysql-&mysql-version;.tar.gz">
[f267149]11 <!ENTITY mysql-md5sum "a90d87a71fa3c23dff6d78afc8e3184c">
12 <!ENTITY mysql-size "23 MB">
13 <!ENTITY mysql-buildsize "492 MB (additional 250 MB to run the test suite)">
[d939eba]14 <!ENTITY mysql-time "4.7 SBU (Test suite is an additional 61 minutes, only partially CPU dependent)">
[08254fc]15]>
16
[c30b739]17<sect1 id="mysql" xreflabel="MySQL-&mysql-version;">
[22c7fe6]18 <?dbhtml filename="mysql.html"?>
19
20 <sect1info>
21 <othername>$LastChangedBy$</othername>
22 <date>$Date$</date>
23 </sect1info>
24
25 <title>MySQL-&mysql-version;</title>
26
27 <indexterm zone="mysql">
28 <primary sortas="a-MySQL">MySQL</primary>
29 </indexterm>
30
31 <sect2 role="package">
32 <title>Introduction to MySQL</title>
33
34 <para><application>MySQL</application> is a widely used and fast SQL
35 database server. It is a client/server implementation that consists of a
36 server daemon and many different client programs and libraries.</para>
37
[d0151ee]38 <para>There may be a more recent release available from the
39 <application>MySQL</application> home page. You can check
40 <ulink url="http://dev.mysql.com/"/> and probably use the
41 existing BLFS instructions. Note that versions other than the one shown
42 in the download URLs have not been tested in a BLFS environment.</para>
43
[a40fc14]44 <para>&lfssvn_checked;20100806&lfssvn_checked2;</para>
[fa050c09]45
[22c7fe6]46 <bridgehead renderas="sect3">Package Information</bridgehead>
47 <itemizedlist spacing="compact">
48 <listitem>
49 <para>Download (HTTP): <ulink url="&mysql-download-http;"/></para>
50 </listitem>
51 <listitem>
52 <para>Download (FTP): <ulink url="&mysql-download-ftp;"/></para>
53 </listitem>
54 <listitem>
55 <para>Download MD5 sum: &mysql-md5sum;</para>
56 </listitem>
57 <listitem>
58 <para>Download size: &mysql-size;</para>
59 </listitem>
60 <listitem>
61 <para>Estimated disk space required: &mysql-buildsize;</para>
62 </listitem>
63 <listitem>
64 <para>Estimated build time: &mysql-time;</para>
65 </listitem>
66 </itemizedlist>
67
[f267149]68 <bridgehead renderas="sect3">Additional Download</bridgehead>
[9c98f0e]69 <itemizedlist spacing="compact">
70 <listitem>
[f267149]71 <para>Required Patch:
72 <ulink url="&patch-root;/mysql-&mysql-version;-makefile-1.patch"/>
73 </para>
[9c98f0e]74 </listitem>
75 </itemizedlist>
76
[1e11f8e]77 <bridgehead renderas="sect3">MySQL Dependencies</bridgehead>
[22c7fe6]78
[f267149]79 <bridgehead renderas="sect4">Recommended</bridgehead>
80 <para role="optional"><xref linkend="openssl"/></para>
81
[22c7fe6]82 <bridgehead renderas="sect4">Optional</bridgehead>
[f267149]83 <para role="optional"><xref linkend="tcpwrappers"/></para>
[9f12e36]84
[9b603d4]85 <!-- Removing libedit because it causes more problems than it solves.
[9f12e36]86
[22c7fe6]87 <ulink url="http://sourceforge.net/projects/libedit/">libedit</ulink>
[9b603d4]88 (as an alternative to readline)-->
[9f12e36]89
[3cb0c57]90 <para condition="html" role="usernotes">User Notes:
91 <ulink url="&blfs-wiki;/mysql"/></para>
92
[22c7fe6]93 </sect2>
94
95 <sect2 role="installation">
96 <title>Installation of MySQL</title>
97
98 <para>For security reasons, running the server as an unprivileged user
99 and group is strongly encouraged:</para>
100
[b785ab29]101<screen role="root"><userinput>groupadd -g 40 mysql &amp;&amp;
102useradd -c "MySQL Server" -d /dev/null -g mysql -s /bin/false \
103 -u 40 mysql</userinput></screen>
[22c7fe6]104
[9c98f0e]105 <note><para>There are a great many options available to
106 <userinput>./configure</userinput>. Check the output of the
107 <option>--help</option> option for additional customization
108 options.</para></note>
109
[22c7fe6]110 <para>Build and install <application>MySQL</application> by
111 running the following commands:</para>
112
[f267149]113<screen><userinput>patch -Np1 -i ../mysql-&mysql-version;-makefile-1.patch &amp;&amp;
114CFLAGS="-O3" \
115CXX=gcc \
116CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" \
[9b603d4]117./configure --prefix=/usr \
[9dfd852b]118 --sysconfdir=/etc \
119 --libexecdir=/usr/sbin \
120 --localstatedir=/srv/mysql \
121 --enable-thread-safe-client \
122 --enable-assembler \
123 --enable-local-infile \
124 --with-unix-socket-path=/var/run/mysql/mysql.sock \
125 --without-debug \
[9b603d4]126 --without-readline \
[9c98f0e]127 --with-plugins=innobase,myisam \
128 --with-extra-charsets=all \
129 --with-ssl &amp;&amp;
130make</userinput></screen>
[68196987]131
[d939eba]132 <para>To test the results, issue: <command>make test-force 2>&amp;1 | tee
133 test.log</command>. This forces the test to run to completion and logs all
134 the test output. There will be many tests that are not run due to
[f267149]135 configuration options and developer considerations. Note that if you use
136 TCP Wrappers and have a restrictive <filename>/etc/hosts.deny</filename>
137 file, you will need to add an appropriate entry to the
138 <filename>/etc/hosts.allow</filename> file for the
139 <command>mysqld</command> daemon. Otherwise many of the tests will
[d939eba]140 fail.</para>
[9e69cae]141
[22c7fe6]142 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
[20f5e71a]143
[9c98f0e]144<screen role="root"><userinput>make benchdir_root=/tmp/mysql-bench install &amp;&amp;
[9dfd852b]145rm -rf /tmp/mysql &amp;&amp;
[9ad2f59]146pushd /usr/lib &amp;&amp;
147ln -v -sf mysql/libmysqlclient{,_r}.so* . &amp;&amp;
148popd &amp;&amp;
[a41f643]149
[9ad2f59]150pushd /usr/share/info &amp;&amp;
151rm -v dir &amp;&amp;
152for FILENAME in *; do
153 install-info $FILENAME dir 2>/dev/null
154done &amp;&amp;
155popd</userinput></screen>
[4b93ac2]156
[039736d2]157 <tip>
158 <para>The only documentation shipped in the source tarball are
[f267149]159 <filename>mysql.info</filename> and man pages. You can download various
[a41f643]160 formats of the <application>MySQL</application> Reference Manual
[d939eba]161 from <ulink url="http://dev.mysql.com/doc/"/>.</para>
[039736d2]162 </tip>
[36769b3]163
[22c7fe6]164 </sect2>
[4b93ac2]165
[22c7fe6]166 <sect2 role="commands">
167 <title>Command Explanations</title>
[08254fc]168
[f267149]169 <para><parameter>CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors
170 -fno-exceptions -fno-rtti"</parameter>: These optimizations are recommended
171 by th edevelopers.</para>
172
[22c7fe6]173 <para><parameter>--libexecdir=/usr/sbin</parameter>: This switch installs
[9dfd852b]174 the <command>mysqld</command> daemon and the
175 <command>mysqlmanager</command> program in an appropriate location.</para>
[08254fc]176
[22c7fe6]177 <para><parameter>--localstatedir=/srv/mysql</parameter>: This switch
178 forces <application>MySQL</application> to use
179 <filename class='directory'>/srv/mysql</filename> for database files and
180 other variable data.</para>
[4b93ac2]181
[22c7fe6]182 <para><parameter>--enable-thread-safe-client</parameter>: This
183 switch compiles a thread-safe <application>MySQL</application> client
184 library.</para>
[4b93ac2]185
[22c7fe6]186 <para><parameter>--enable-assembler</parameter>: This switch allows using
187 assembler versions of some string functions.</para>
[4b93ac2]188
[22c7fe6]189 <para><parameter>--enable-local-infile</parameter>: This switch enables
190 the <quote>LOAD DATA INFILE</quote> SQL statement.</para>
[4b93ac2]191
[22c7fe6]192 <para><parameter>--with-unix-socket-path=/var/run/mysql</parameter>:
[db9754e]193 This switch puts the unix-domain socket into the
194 <filename class="directory">/var/run/mysql</filename> directory instead of
195 the default <filename class="directory">/tmp</filename>.</para>
[867e611]196
[22c7fe6]197 <para><parameter>--without-readline</parameter>: This switch forces the
198 build to use the system copy of <application>readline</application> instead
199 of the bundled copy.</para>
[867e611]200
[9f12e36]201 <para><parameter>--with-extra-charsets=all</parameter>: This switch enables
[9b603d4]202 international character sets within the suite.</para>
203
[9c98f0e]204 <para><parameter>--with-plugins=innobase,myisam</parameter>: This switch enables
205 two useful table types. Check <command>./configure --help</command> for
206 other table types.</para>
207
[6a07e73]208 <para><parameter>--with-ssl</parameter>: This switch enables encrypted
209 communication between client and server.</para>
210
[9c98f0e]211 <para><command>make benchdir_root=...</command>: This installs the benchmark
212 and test suites in a non-system location.</para>
[4b93ac2]213
[9dfd852b]214 <para><command>ln -v -sf mysql/libmysqlclient{,_r}.so* .</command>: This
[22c7fe6]215 command makes the <application>MySQL</application> shared libraries
216 available to other packages at run-time.</para>
[08254fc]217
[22c7fe6]218 <para><option>--with-openssl</option>: This switch adds OpenSSL support
219 to <application>MySQL</application>.</para>
[867e611]220
[9dfd852b]221 <para><option>--with-libwrap</option>: This switch adds tcpwrappers
[9b603d4]222 support to <application>MySQL</application>.</para>
[9dfd852b]223
[9ad2f59]224 <para><command>pushd ... popd</command>: This set of commands rebuilds the
225 <filename>/usr/share/info/dir</filename> file as the installation failed
226 to do so.</para>
227
[22c7fe6]228 </sect2>
[08254fc]229
[22c7fe6]230 <sect2 role="configuration">
231 <title>Configuring MySQL</title>
[08254fc]232
[22c7fe6]233 <sect3 id="mysql-config">
234 <title>Config Files</title>
[08254fc]235
[22c7fe6]236 <para><filename>/etc/my.cnf</filename> and
237 <filename>~/.my.cnf</filename></para>
[08254fc]238
[22c7fe6]239 <indexterm zone="mysql mysql-config">
240 <primary sortas="e-AA.my.cnf">~/.my.cnf</primary>
241 </indexterm>
[08254fc]242
[22c7fe6]243 <indexterm zone="mysql mysql-config">
244 <primary sortas="e-etc-my.cnf">/etc/my.cnf</primary>
245 </indexterm>
[08254fc]246
[22c7fe6]247 </sect3>
[08254fc]248
[22c7fe6]249 <sect3>
250 <title>Configuration Information</title>
[08254fc]251
[22c7fe6]252 <para>There are several default configuration files available in
253 <filename class="directory">/usr/share/mysql</filename> which you can
254 use. Create <filename>/etc/my.cnf</filename> using the following command
255 as the <systemitem class="username">root</systemitem> user:</para>
[08254fc]256
[9c98f0e]257<screen role="root"><userinput>install -v -m644 /usr/share/mysql/my-medium.cnf /etc/my.cnf
258sed -i -e s/^skip-federated/#skip-federated/ /etc/my.cnf</userinput></screen>
259
260 <para>The change to <filename>/etc/my.cnf</filename> can be omitted if the
261 option <option>--with-plugins=federated</option> is used.</para>
[08254fc]262
[22c7fe6]263 <para>You can now install a database and change the ownership to the
264 unprivileged user and group (perform as the <systemitem
265 class="username">root</systemitem> user):</para>
[08254fc]266
[22c7fe6]267<screen role="root"><userinput>mysql_install_db --user=mysql &amp;&amp;
268chgrp -v mysql /srv/mysql{,/test,/mysql}</userinput></screen>
[08254fc]269
[22c7fe6]270 <para>Further configuration requires that the
[9dfd852b]271 <application>MySQL</application> server is running. Start
[22c7fe6]272 the server using the following commands as the <systemitem
273 class="username">root</systemitem> user:</para>
[08254fc]274
[515209b3]275<screen role="root"><userinput>install -v -m755 -o mysql -g mysql -d /var/run/mysql &amp;&amp;
[22c7fe6]276mysqld_safe --user=mysql 2&gt;&amp;1 &gt;/dev/null &amp;</userinput></screen>
[08254fc]277
[9dfd852b]278 <para>A default installation does not set up a password for the
[22c7fe6]279 administrator, so use the following command as the <systemitem
280 class="username">root</systemitem> user to set one. Replace
[3cb0c57]281 <replaceable>&lt;new-password&gt;</replaceable> with your own.</para>
[08254fc]282
[3cb0c57]283<screen role="root"><userinput>mysqladmin -u root password <replaceable>&lt;new-password&gt;</replaceable></userinput></screen>
[08254fc]284
[22c7fe6]285 <para>Configuration of the server is now finished. Shut the server
286 down using the following command as the <systemitem
287 class="username">root</systemitem> user:</para>
[4b93ac2]288
[22c7fe6]289<screen role="root"><userinput>mysqladmin -p shutdown</userinput></screen>
[08254fc]290
[22c7fe6]291 </sect3>
[08254fc]292
[22c7fe6]293 <sect3 id="mysql-init">
294 <title>Boot Script</title>
[08254fc]295
[22c7fe6]296 <para>Install the <filename>/etc/rc.d/init.d/mysql</filename> init script
[5254d12]297 included in the <xref linkend="bootscripts"/> package as
[22c7fe6]298 the <systemitem class="username">root</systemitem> user to start the
299 <application>MySQL</application> server during system boot-up.</para>
[08254fc]300
[22c7fe6]301 <indexterm zone="mysql mysql-init">
302 <primary sortas="f-mysql">mysql</primary>
303 </indexterm>
[20f5e71a]304
[22c7fe6]305<screen role="root"><userinput>make install-mysql</userinput></screen>
[20f5e71a]306
[22c7fe6]307 </sect3>
[08254fc]308
[22c7fe6]309 </sect2>
[08254fc]310
[22c7fe6]311 <sect2 role="content">
312 <title>Contents</title>
313
314 <segmentedlist>
315 <segtitle>Installed Programs</segtitle>
316 <segtitle>Installed Libraries</segtitle>
317 <segtitle>Installed Directories</segtitle>
318
319 <seglistitem>
[9dfd852b]320 <seg>comp_err, innochecksum, msql2mysql, my_print_defaults,
321 myisam_ftdump, myisamchk, myisamlog, myisampack, mysql,
322 mysql_client_test, mysql_config, mysql_convert_table_format,
323 mysql_create_system_tables, mysql_explain_log, mysql_find_rows,
324 mysql_fix_extensions, mysql_fix_privilege_tables, mysql_install_db,
325 mysql_secure_installation, mysql_setpermission, mysql_tableinfo,
326 mysql_tzinfo_to_sql, mysql_waitpid, mysql_zap, mysqlaccess, mysqladmin,
327 mysqlbinlog, mysqlbug, mysqlcheck, mysqld, mysqld_multi, mysqld_safe,
328 mysqldump, mysqldumpslow, mysqlhotcopy, mysqlimport, mysqlmanager,
329 mysqlshow, mysqltest, mysqltestmanager, mysqltestmanager-pwgen,
330 mysqltestmanagerc, perror, replace, resolve_stack_dump, and
331 resolveip</seg>
332 <seg>libdbug.a, libheap.a, libmyisam.a, libmyisammrg.a,
[3cb0c57]333 libmysqlclient.{so,a}, libmysqlclient_r.{so,a}, libmystrings.a,
[9dfd852b]334 libmysys.a, and libvio.a</seg>
[22c7fe6]335 <seg>/srv/mysql, /usr/include/mysql, /usr/lib/mysql, /usr/share/mysql, and
336 /var/run/mysql</seg>
337 </seglistitem>
338 </segmentedlist>
339
340 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
341
342 <para>Descriptions of all the programs and libraries would be several
[9dfd852b]343 pages long. Instead, consult the <filename>mysql.info</filename>
344 documentation or the on-line reference manual at <ulink
345 url="http://dev.mysql.com/doc/refman/5.0/en/index.html"/>.</para>
[22c7fe6]346
[9dfd852b]347 <para>The <application>Perl</application> DBI modules must be installed
348 for some of the <application>MySQL</application> support programs to
349 function properly.</para>
[22c7fe6]350
351 </sect2>
[f45b1953]352
353</sect1>
Note: See TracBrowser for help on using the repository browser.