source: content/databases/mysql.xml@ 4b93ac2

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.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 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 4b93ac2 was 4b93ac2, checked in by Randy McMurchy <randy@…>, 20 years ago

Fixed MySQL instructions to build against NPTL and added optional dependencies and command explanations

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

  • Property mode set to 100644
File size: 9.8 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-size "13.5 MB">
10 <!ENTITY mysql-buildsize "98.7 MB">
11 <!ENTITY mysql-time "3.43 SBU">
12]>
13
14<sect1 id="mysql" xreflabel="MySQL-&mysql-version;">
15<?dbhtml filename="mysql.html"?>
16<title>MySQL-&mysql-version;</title>
17
18<sect2>
19<title>Introduction to <application>My<acronym>SQL</acronym></application>
20</title>
21
22<para><application>My<acronym>SQL</acronym></application> is a widely used and
23fast <acronym>SQL</acronym> database server. It is a client/server
24implementation that consists of a server daemon and many different
25client programs and libraries.</para>
26
27<sect3><title>Package information</title>
28<itemizedlist spacing='compact'>
29<listitem><para>Download (HTTP): <ulink url="&mysql-download-http;"/></para></listitem>
30<listitem><para>Download (FTP): <ulink url="&mysql-download-ftp;"/></para></listitem>
31<listitem><para>Download size: &mysql-size;</para></listitem>
32<listitem><para>Estimated Disk space required: &mysql-buildsize;</para></listitem>
33<listitem><para>Estimated build time: &mysql-time;</para></listitem></itemizedlist>
34</sect3>
35
36<sect3><title>Additional downloads</title>
37<itemizedlist spacing='compact'>
38<listitem><para>Required Patch (for building against NPTL): <ulink
39url="&patch-root;/mysql-&mysql-version;-nptl-1.patch"/></para></listitem>
40</itemizedlist></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>patch -Np1 -i ../mysql-&mysql-version;-nptl-1.patch &amp;&amp;
66./configure --prefix=/usr --sysconfdir=/etc \
67 --libexecdir=/usr/sbin --localstatedir=/srv/mysql \
68 --enable-thread-safe-client --enable-assembler \
69 --without-readline --without-debug \
70 --enable-local-infile --without-bench &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><command>make testdir=...</command>: This installs the test suite in
107<filename class='directory'>/usr/lib/mysql/mysql-test</filename>.
108<acronym>BLFS</acronym> is currently seeking a method to omit the installation
109of the test suite altogether.</para>
110
111<para><command>ln -sf mysql/libmysqlclient{,_r}.so* .</command>: This commands
112makes the <application>My<acronym>SQL</acronym></application> shared libraries
113available to other packages at run-time.</para>
114
115</sect2>
116
117<sect2>
118<title>Configuring <application>My<acronym>SQL</acronym></application></title>
119
120<sect3>
121<title>Config files</title>
122
123<para><filename>/etc/my.cnf</filename>, <filename>~/.my.cnf</filename></para>
124
125</sect3>
126
127<sect3>
128<title>Configuration Information</title>
129
130<para>There are several default configuration files available in
131<filename class="directory">/usr/share/mysql</filename> which you can
132use. Create <filename>/etc/my.cnf</filename> using the following
133command:</para>
134
135<screen><userinput><command>cp /usr/share/mysql/my-medium.cnf /etc/my.cnf</command></userinput></screen>
136
137<para>You can now install a database and change the ownership to the
138unprivileged user and group.</para>
139
140<screen><userinput><command>mysql_install_db &amp;&amp;
141chown -R mysql:mysql /srv/mysql</command></userinput></screen>
142
143<para>Further configuration requires that the
144<application>My<acronym>SQL</acronym></application> server be running:</para>
145
146<screen><userinput><command>mysqld_safe --user=mysql 2&gt;&amp;1 &gt;/dev/null &amp;</command></userinput></screen>
147
148<para>A default installation does not setup a password for the administrator,
149so use the following command to set one. Replace
150<replaceable>[new-password]</replaceable> with your own.</para>
151
152<!--
153<screen><userinput><command>mysql -uroot mysql</command></userinput>
154Welcome to the MySQL monitor. Commands end with ; or \g.
155Your MySQL connection id is 2 to server version: 3.23.51-log
156
157Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
158
159<prompt>mysql&gt;</prompt> <userinput><command>UPDATE user SET password=password('<replaceable>new-password</replaceable>') WHERE user='root';</command></userinput>
160Query OK, 2 rows affected (0.00 sec)
161Rows matched: 2 Changed: 2 Warnings: 0
162
163<prompt>mysql&gt;</prompt> <userinput><command>FLUSH PRIVILEGES;</command></userinput>
164Query OK, 0 rows affected (0.00 sec)
165
166<prompt>mysql&gt;</prompt> <userinput><command>EXIT;</command></userinput>
167bye
168</screen>
169-->
170
171<screen><userinput><command>mysqladmin -u root password <replaceable>[new-password]</replaceable></command></userinput></screen>
172
173<para>Configuration of the server is now finished. Shut the server down
174using the following command:</para>
175
176<screen><userinput><command>mysqladmin -p shutdown</command></userinput></screen>
177
178<para>Install the <filename>/etc/rc.d/init.d/mysql</filename>
179init script included in the <xref linkend="intro-important-bootscripts"/>
180package.</para>
181
182<screen><userinput><command>make install-mysql</command></userinput></screen>
183
184</sect3>
185
186</sect2>
187
188<sect2>
189<title>Contents</title>
190
191<para>The <application>My<acronym>SQL</acronym></application> package contains <command>
192comp_err</command>, <command>
193isamchk</command>, <command>
194isamlog</command>, <command>
195make_win_binary_distribution</command>, <command>
196make_win_src_distribution</command>, <command>
197msql2mysql</command>, <command>
198my_print_defaults</command>, <command>
199myisam_ftdump</command>, <command>
200myisamchk</command>, <command>
201myisamlog</command>, <command>
202myisampack</command>, <command>
203mysql</command>, <command>
204mysql_config</command>, <command>
205mysql_convert_table_format</command>, <command>
206mysql_explain_log</command>, <command>
207mysql_find_rows</command>, <command>
208mysql_fix_extensions</command>, <command>
209mysql_fix_privilege_tables</command>, <command>
210mysql_install</command>, <command>
211mysql_install_db</command>, <command>
212mysql_secure_installation</command>, <command>
213mysql_setpermission</command>, <command>
214mysql_tableinfo</command>, <command>
215mysql_waitpid</command>, <command>
216mysql_zap</command>, <command>
217mysqlacess</command>,<command>
218mysqladmin</command>, <command>
219mysqlbinlog</command>, <command>
220mysqlbug</command>, <command>
221mysqlcheck</command>, <command>
222mysqld</command>, <command>
223mysqld_multi</command>, <command>
224mysqld_safe</command>, <command>
225mysqldump</command>, <command>
226mysqldumpslow</command>, <command>
227mysqlhotcopy</command>, <command>
228mysqlimport</command>, <command>
229mysqlmanager</command>, <command>
230mysqlmanager-pwgen</command>, <command>
231mysqlmanagerc</command>, <command>
232mysqlshow</command>, <command>
233mysqltest</command>, <command>
234pack_isam</command>, <command>
235perror</command>, <command>
236replace</command>, <command>
237resolve_stack_dump</command>, <command>
238resolveip</command>, <filename class="libraryfile">
239libdbug</filename>, <filename class="libraryfile">
240libheap</filename>, <filename class="libraryfile">
241libmerge</filename>, <filename class="libraryfile">
242libmyisam</filename>, <filename class="libraryfile">
243libmyisammrg</filename>, <filename class="libraryfile">
244libmysqlclient</filename>, <filename class="libraryfile">
245libmysqlclient_r</filename>, <filename class="libraryfile">
246libmystrings</filename>, <filename class="libraryfile">
247libmysys</filename>, <filename class="libraryfile">
248libnisam</filename> and <filename class="libraryfile">
249libvio</filename>.</para>
250
251</sect2>
252
253<sect2><title>Description</title>
254
255<para>A package listing would be several pages long. Consult the
256<application>My<acronym>SQL</acronym></application> documentation for full
257details instead.</para>
258
259<para>Certain <application>My<acronym>SQL</acronym></application> support
260programs may require the <application>Perl</application> DBI modules to be
261installed to function properly.</para>
262
263</sect2>
264
265</sect1>
Note: See TracBrowser for help on using the repository browser.