source: content/databases/mysql.xml@ c2c2d76

10.0 10.1 11.0 11.1 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 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 krejzi/svn lazarus nosym perl-modules qt5new systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/test-20220226
Last change on this file since c2c2d76 was c2c2d76, checked in by Igor Živković <igor@…>, 18 years ago

Changed MySQL instructions to compile without NPTL patch.

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

  • Property mode set to 100644
File size: 10.0 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY mysql-download-http "http://mysql.he.net/Downloads/MySQL-4.0/mysql-&mysql-version;.tar.gz">
8 <!ENTITY mysql-download-ftp "ftp://mirror.mcs.anl.gov/pub/mysql/Downloads/MySQL-4.0/mysql-&mysql-version;.tar.gz">
9 <!ENTITY mysql-md5 "0a3dae16519afa5e59d8b9e252181243">
10 <!ENTITY mysql-size "13.5 MB">
11 <!ENTITY mysql-buildsize "98.7 MB">
12 <!ENTITY mysql-time "3.43 SBU">
13]>
14
15<sect1 id="mysql" xreflabel="MySQL-&mysql-version;">
16<sect1info>
17<othername>$LastChangedBy$</othername>
18<date>$Date$</date>
19</sect1info>
20<?dbhtml filename="mysql.html"?>
21<title>MySQL-&mysql-version;</title>
22
23<sect2>
24<title>Introduction to <application>My<acronym>SQL</acronym></application>
25</title>
26
27<para><application>My<acronym>SQL</acronym></application> is a widely used and
28fast <acronym>SQL</acronym> database server. It is a client/server
29implementation that consists of a server daemon and many different
30client programs and libraries.</para>
31
32<sect3><title>Package information</title>
33<itemizedlist spacing='compact'>
34<listitem><para>Download (HTTP): <ulink url="&mysql-download-http;"/></para></listitem>
35<listitem><para>Download (FTP): <ulink url="&mysql-download-ftp;"/></para></listitem>
36<listitem><para>MD5 Sum: &mysql-md5;</para></listitem>
37<listitem><para>Download size: &mysql-size;</para></listitem>
38<listitem><para>Estimated Disk space required: &mysql-buildsize;</para></listitem>
39<listitem><para>Estimated build time: &mysql-time;</para></listitem></itemizedlist>
40</sect3>
41
42<sect3><title><application>My<acronym>SQL</acronym></application> dependencies
43</title>
44<sect4><title>Optional</title>
45<para><xref linkend="openssl"/>, <xref linkend="tcpwrappers"/>,
46<xref linkend="which"/> and <xref linkend="ORBit"/>
47</para></sect4>
48</sect3>
49
50</sect2>
51
52<sect2>
53<title>Installation of <application>My<acronym>SQL</acronym></application>
54</title>
55
56<para>For security reasons, running the server as an unprivileged user
57and group is strongly encouraged:</para>
58
59<screen><userinput><command>groupadd mysql &amp;&amp;
60useradd -c mysql -d /dev/null -g mysql -s /bin/false mysql</command></userinput></screen>
61
62<para>Build and install <application>My<acronym>SQL</acronym></application> by
63running the following commands:</para>
64
65<screen><userinput><command>CPPFLAGS="-D_GNU_SOURCE" ./configure --prefix=/usr --sysconfdir=/etc \
66 --libexecdir=/usr/sbin --localstatedir=/srv/mysql \
67 --enable-thread-safe-client --enable-assembler \
68 --without-readline --without-debug \
69 --enable-local-infile --without-bench \
70 --with-named-thread-libs=-lpthread &amp;&amp;
71make testdir=/usr/lib/mysql/mysql-test &amp;&amp;
72make testdir=/usr/lib/mysql/mysql-test install &amp;&amp;
73cd /usr/lib &amp;&amp;
74ln -sf mysql/libmysqlclient{,_r}.so* .</command></userinput></screen>
75
76</sect2>
77
78<sect2>
79<title>Command explanations</title>
80
81<para><parameter>--libexecdir=/usr/sbin</parameter>: This switch installs the
82<command>mysqld</command> daemon in an appropriate location.</para>
83
84<para><parameter>--localstatedir=/srv/mysql</parameter>: This switch forces
85<application>My<acronym>SQL</acronym></application> to use
86<filename class='directory'>/srv/mysql</filename> for database files and other
87variable data.</para>
88
89<para><parameter>--enable-thread-safe-client</parameter>: This switch compiles a
90thread-safe <application>My<acronym>SQL</acronym></application> client library.
91</para>
92
93<para><parameter>--enable-assembler</parameter>: This switch allows using
94assembler versions of some string functions.</para>
95
96<para><parameter>--without-readline</parameter>: This switch forces the build
97to use the system copy of <application>readline</application> instead of the
98bundled copy.</para>
99
100<para><option>--enable-local-infile</option>: This switch enables the
101LOAD DATA INFILE <acronym>SQL</acronym> statement.</para>
102
103<para><option>--without-bench</option>: This switch skips building the
104benchmark suite.</para>
105
106<para><parameter>CPPFLAGS="-D_GNU_SOURCE" --with-named-thread-libs=-lpthread</parameter>:
107This environment variable and configure switch enable building on
108<acronym>NPTL</acronym> systems.</para>
109
110<para><command>make testdir=...</command>: This installs the test suite in
111<filename class='directory'>/usr/lib/mysql/mysql-test</filename>.
112<acronym>BLFS</acronym> is currently seeking a method to omit the installation
113of the test suite altogether.</para>
114
115<para><command>ln -sf mysql/libmysqlclient{,_r}.so* .</command>: This command
116makes the <application>My<acronym>SQL</acronym></application> shared libraries
117available to other packages at run-time.</para>
118
119</sect2>
120
121<sect2>
122<title>Configuring <application>My<acronym>SQL</acronym></application></title>
123
124<sect3>
125<title>Config files</title>
126
127<para><filename>/etc/my.cnf</filename>, <filename>~/.my.cnf</filename></para>
128
129</sect3>
130
131<sect3>
132<title>Configuration Information</title>
133
134<para>There are several default configuration files available in
135<filename class="directory">/usr/share/mysql</filename> which you can
136use. Create <filename>/etc/my.cnf</filename> using the following
137command:</para>
138
139<screen><userinput><command>cp /usr/share/mysql/my-medium.cnf /etc/my.cnf</command></userinput></screen>
140
141<para>You can now install a database and change the ownership to the
142unprivileged user and group.</para>
143
144<screen><userinput><command>mysql_install_db &amp;&amp;
145chown -R mysql:mysql /srv/mysql</command></userinput></screen>
146
147<para>Further configuration requires that the
148<application>My<acronym>SQL</acronym></application> server be running:</para>
149
150<screen><userinput><command>mysqld_safe --user=mysql 2&gt;&amp;1 &gt;/dev/null &amp;</command></userinput></screen>
151
152<para>A default installation does not setup a password for the administrator,
153so use the following command to set one. Replace
154<replaceable>[new-password]</replaceable> with your own.</para>
155
156<!--
157<screen><userinput><command>mysql -uroot mysql</command></userinput>
158Welcome to the MySQL monitor. Commands end with ; or \g.
159Your MySQL connection id is 2 to server version: 3.23.51-log
160
161Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
162
163<prompt>mysql&gt;</prompt> <userinput><command>UPDATE user SET password=password('<replaceable>new-password</replaceable>') WHERE user='root';</command></userinput>
164Query OK, 2 rows affected (0.00 sec)
165Rows matched: 2 Changed: 2 Warnings: 0
166
167<prompt>mysql&gt;</prompt> <userinput><command>FLUSH PRIVILEGES;</command></userinput>
168Query OK, 0 rows affected (0.00 sec)
169
170<prompt>mysql&gt;</prompt> <userinput><command>EXIT;</command></userinput>
171bye
172</screen>
173-->
174
175<screen><userinput><command>mysqladmin -u root password <replaceable>[new-password]</replaceable></command></userinput></screen>
176
177<para>Configuration of the server is now finished. Shut the server down
178using the following command:</para>
179
180<screen><userinput><command>mysqladmin -p shutdown</command></userinput></screen>
181
182<para>Install the <filename>/etc/rc.d/init.d/mysql</filename>
183init script included in the <xref linkend="intro-important-bootscripts"/>
184package.</para>
185
186<screen><userinput><command>make install-mysql</command></userinput></screen>
187
188</sect3>
189
190</sect2>
191
192<sect2>
193<title>Contents</title>
194
195<para>The <application>My<acronym>SQL</acronym></application> package contains <command>
196comp_err</command>, <command>
197isamchk</command>, <command>
198isamlog</command>, <command>
199make_win_binary_distribution</command>, <command>
200make_win_src_distribution</command>, <command>
201msql2mysql</command>, <command>
202my_print_defaults</command>, <command>
203myisam_ftdump</command>, <command>
204myisamchk</command>, <command>
205myisamlog</command>, <command>
206myisampack</command>, <command>
207mysql</command>, <command>
208mysql_config</command>, <command>
209mysql_convert_table_format</command>, <command>
210mysql_explain_log</command>, <command>
211mysql_find_rows</command>, <command>
212mysql_fix_extensions</command>, <command>
213mysql_fix_privilege_tables</command>, <command>
214mysql_install</command>, <command>
215mysql_install_db</command>, <command>
216mysql_secure_installation</command>, <command>
217mysql_setpermission</command>, <command>
218mysql_tableinfo</command>, <command>
219mysql_waitpid</command>, <command>
220mysql_zap</command>, <command>
221mysqlacess</command>,<command>
222mysqladmin</command>, <command>
223mysqlbinlog</command>, <command>
224mysqlbug</command>, <command>
225mysqlcheck</command>, <command>
226mysqld</command>, <command>
227mysqld_multi</command>, <command>
228mysqld_safe</command>, <command>
229mysqldump</command>, <command>
230mysqldumpslow</command>, <command>
231mysqlhotcopy</command>, <command>
232mysqlimport</command>, <command>
233mysqlmanager</command>, <command>
234mysqlmanager-pwgen</command>, <command>
235mysqlmanagerc</command>, <command>
236mysqlshow</command>, <command>
237mysqltest</command>, <command>
238pack_isam</command>, <command>
239perror</command>, <command>
240replace</command>, <command>
241resolve_stack_dump</command>, <command>
242resolveip</command>, <filename class="libraryfile">
243libdbug</filename>, <filename class="libraryfile">
244libheap</filename>, <filename class="libraryfile">
245libmerge</filename>, <filename class="libraryfile">
246libmyisam</filename>, <filename class="libraryfile">
247libmyisammrg</filename>, <filename class="libraryfile">
248libmysqlclient</filename>, <filename class="libraryfile">
249libmysqlclient_r</filename>, <filename class="libraryfile">
250libmystrings</filename>, <filename class="libraryfile">
251libmysys</filename>, <filename class="libraryfile">
252libnisam</filename> and <filename class="libraryfile">
253libvio</filename>.</para>
254
255</sect2>
256
257<sect2><title>Description</title>
258
259<para>A package listing would be several pages long. Consult the
260<application>My<acronym>SQL</acronym></application> documentation for full
261details instead.</para>
262
263<para>Certain <application>My<acronym>SQL</acronym></application> support
264programs may require the <application>Perl</application> DBI modules to be
265installed to function properly.</para>
266
267</sect2>
268
269</sect1>
Note: See TracBrowser for help on using the repository browser.