source: server/databases/mysql.xml@ 7224506

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 7224506 was b88be39, checked in by Bruce Dubbs <bdubbs@…>, 13 years ago

Update to cmake-2.8.6.
Update to curl-7.22.0.
Updated to libarchive-2.8.5.
Reset all python references to python2.

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

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