source: server/databases/mysql.xml@ 9dcda46

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.3 6.3-rc1 6.3-rc2 6.3-rc3 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 9dcda46 was 1e642794, checked in by Randy McMurchy <randy@…>, 17 years ago

Fixed broken download URLs in the Tin, RSync, PostgreSQL, MySQL and Apache HTTPD server instructions

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

  • Property mode set to 100644
File size: 13.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!-- <!ENTITY mysql-download-http "http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-&mysql-version;.tar.gz/from/http://mysql.mirrors.hoobly.com/"> -->
8 <!-- <!ENTITY mysql-download-ftp "ftp://mirror.mcs.anl.gov/pub/mysql/Downloads/MySQL-5.0/mysql-&mysql-version;.tar.gz"> -->
9 <!ENTITY mysql-download-http "http://downloads.mysql.com/archives/mysql-5.0/mysql-&mysql-version;.tar.gz">
10 <!ENTITY mysql-download-ftp "ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/mysql-&mysql-version;.tar.gz">
11 <!ENTITY mysql-md5sum "c3165204c42e1db6fc3a95a4fd2cd22f">
12 <!ENTITY mysql-size "18.6 MB">
13 <!ENTITY mysql-buildsize "244 MB (additional 194 MB to run the test suite)">
14 <!ENTITY mysql-time "4.5 SBU (Test suite is an additional 48 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 <bridgehead renderas="sect3">Package Information</bridgehead>
39 <itemizedlist spacing="compact">
40 <listitem>
41 <para>Download (HTTP): <ulink url="&mysql-download-http;"/></para>
42 </listitem>
43 <listitem>
44 <para>Download (FTP): <ulink url="&mysql-download-ftp;"/></para>
45 </listitem>
46 <listitem>
47 <para>Download MD5 sum: &mysql-md5sum;</para>
48 </listitem>
49 <listitem>
50 <para>Download size: &mysql-size;</para>
51 </listitem>
52 <listitem>
53 <para>Estimated disk space required: &mysql-buildsize;</para>
54 </listitem>
55 <listitem>
56 <para>Estimated build time: &mysql-time;</para>
57 </listitem>
58 </itemizedlist>
59
60 <bridgehead renderas="sect3">MySQL Dependencies</bridgehead>
61
62 <bridgehead renderas="sect4">Optional</bridgehead>
63 <para role="optional"><xref linkend="openssl"/> and
64 <xref linkend="tcpwrappers"/>.
65
66 <!-- Removing libedit because it causes more problems than it solves.
67
68 <ulink url="http://sourceforge.net/projects/libedit/">libedit</ulink>
69 (as an alternative to readline)-->
70
71 </para>
72
73 <!-- These appear to be obsolete now that the docs have been pulled
74 out of the main tarball. Configure still checks for them, but
75 best I can tell, they are not used, nor can be used even if found
76
77 <xref linkend="doxygen"/> and
78 <xref linkend="tetex"/></para>
79 -->
80
81 <para condition="html" role="usernotes">User Notes:
82 <ulink url="&blfs-wiki;/mysql"/></para>
83
84 </sect2>
85
86 <sect2 role="installation">
87 <title>Installation of MySQL</title>
88
89 <para>For security reasons, running the server as an unprivileged user
90 and group is strongly encouraged:</para>
91
92<screen role="root"><userinput>groupadd -g 40 mysql &amp;&amp;
93useradd -c "MySQL Server" -d /dev/null -g mysql -s /bin/false \
94 -u 40 mysql</userinput></screen>
95
96 <para>Build and install <application>MySQL</application> by
97 running the following commands:</para>
98
99 <!-- Removing the CPPFLAGS="-D_GNU_SOURCE" and
100 -with-named-thread-libs=-lpthread as they don't appear to be
101 required any longer
102 -->
103
104<screen><userinput>C_EXTRA_FLAGS=-fno-strict-aliasing \
105./configure --prefix=/usr \
106 --sysconfdir=/etc \
107 --libexecdir=/usr/sbin \
108 --localstatedir=/srv/mysql \
109 --enable-thread-safe-client \
110 --enable-assembler \
111 --enable-local-infile \
112 --with-unix-socket-path=/var/run/mysql/mysql.sock \
113 --without-debug \
114 --without-bench \
115 --without-readline \
116 --with-berkeley-db \
117 --with-extra-charsets=all &amp;&amp;
118make testdir=/tmp/mysql</userinput></screen>
119
120<!--
121 <para>Some of the tests in the test suite are known to fail and this will
122 cause the test suite to abort at that point. Issue the following command
123 to disable the tests known to fail:</para>
124
125<screen><userinput>for TESTFILE in information_schema innodb join mysql_client_test \
126 ps_2myisam ps_3innodb ps_4heap ps_5merge \
127 sp-error strict type_float type_ranges
128do
129 mv mysql-test/t/$TESTFILE.test mysql-test/t/$TESTFILE.test.disabled
130done
131unset TESTFILE</userinput></screen>
132-->
133
134 <para>To test the results, issue: <command>make test</command>. Note that
135 if you have a restrictive <filename>/etc/hosts.deny</filename> file, you
136 will need to add an appropriate entry to the
137 <filename>/etc/hosts.allow</filename> file for the
138 <command>mysqld</command> daemon, else many of the tests will fail.</para>
139
140 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
141
142<screen role="root"><userinput>make testdir=/tmp/mysql install &amp;&amp;
143rm -rf /tmp/mysql &amp;&amp;
144cd /usr/lib &amp;&amp;
145ln -v -sf mysql/libmysqlclient{,_r}.so* .</userinput></screen>
146
147<!-- Insert this back into the 'root' installation section if
148 there are ever docs to install again
149
150install -v -d -m755 /usr/share/mysql/Docs/Images &amp;&amp;
151install -v -m644 Docs/manual{,_toc}.html \
152 Docs/manual.txt /usr/share/mysql/Docs &amp;&amp;
153install -v -m644 Docs/Images/*.{jpg,gif} /usr/share/mysql/Docs/Images &amp;&amp;
154
155-->
156
157 </sect2>
158
159 <sect2 role="commands">
160 <title>Command Explanations</title>
161
162 <para><parameter>C_EXTRA_FLAGS=-fno-strict-aliasing</parameter>: This
163 environment variable adjusts the compiler optimization to avoid failures in
164 the testsuite and other operations.</para>
165
166 <para><parameter>--libexecdir=/usr/sbin</parameter>: This switch installs
167 the <command>mysqld</command> daemon and the
168 <command>mysqlmanager</command> program in an appropriate location.</para>
169
170 <para><parameter>--localstatedir=/srv/mysql</parameter>: This switch
171 forces <application>MySQL</application> to use
172 <filename class='directory'>/srv/mysql</filename> for database files and
173 other variable data.</para>
174
175 <para><parameter>--enable-thread-safe-client</parameter>: This
176 switch compiles a thread-safe <application>MySQL</application> client
177 library.</para>
178
179 <para><parameter>--enable-assembler</parameter>: This switch allows using
180 assembler versions of some string functions.</para>
181
182 <para><parameter>--enable-local-infile</parameter>: This switch enables
183 the <quote>LOAD DATA INFILE</quote> SQL statement.</para>
184
185 <para><parameter>--with-unix-socket-path=/var/run/mysql</parameter>:
186 This switch puts the unix-domain socket into the
187 <filename class="directory">/var/run/mysql</filename> directory instead of
188 the default <filename class="directory">/tmp</filename>.</para>
189
190 <para><parameter>--without-bench</parameter>: This switch skips building
191 the benchmark suite.</para>
192
193 <para><parameter>--without-readline</parameter>: This switch forces the
194 build to use the system copy of <application>readline</application> instead
195 of the bundled copy.</para>
196
197 <para><parameter>--with-berkeley-db</parameter>: This switch enables
198 using <application>Berkeley DB</application> tables as a back end.</para>
199
200 <para><parameter>--with-extra-charsets=all</parameter>: This switch enables
201 international character sets within the suite.</para>
202
203 <para><command>make testdir=...</command>: This installs the test suite in
204 <filename class='directory'>/tmp/mysql</filename>. The test suite is not
205 required, nor does it function properly on an installed version of
206 <application>MySQL</application>, so it is removed in the next step.</para>
207
208 <para><command>ln -v -sf mysql/libmysqlclient{,_r}.so* .</command>: This
209 command makes the <application>MySQL</application> shared libraries
210 available to other packages at run-time.</para>
211
212 <para><option>--with-openssl</option>: This switch adds OpenSSL support
213 to <application>MySQL</application>.</para>
214
215 <para><option>--with-libwrap</option>: This switch adds tcpwrappers
216 support to <application>MySQL</application>.</para>
217
218 </sect2>
219
220 <sect2 role="configuration">
221 <title>Configuring MySQL</title>
222
223 <sect3 id="mysql-config">
224 <title>Config Files</title>
225
226 <para><filename>/etc/my.cnf</filename> and
227 <filename>~/.my.cnf</filename></para>
228
229 <indexterm zone="mysql mysql-config">
230 <primary sortas="e-AA.my.cnf">~/.my.cnf</primary>
231 </indexterm>
232
233 <indexterm zone="mysql mysql-config">
234 <primary sortas="e-etc-my.cnf">/etc/my.cnf</primary>
235 </indexterm>
236
237 </sect3>
238
239 <sect3>
240 <title>Configuration Information</title>
241
242 <para>There are several default configuration files available in
243 <filename class="directory">/usr/share/mysql</filename> which you can
244 use. Create <filename>/etc/my.cnf</filename> using the following command
245 as the <systemitem class="username">root</systemitem> user:</para>
246
247<screen role="root"><userinput>install -v -m644 /usr/share/mysql/my-medium.cnf /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 --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/mysql, /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.0/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.