source: server/databases/mariadb.xml@ 55c0855

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 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 55c0855 was 55c0855, checked in by Fernando de Oliveira <fernando@…>, 10 years ago

Update to MariaDB-10.0.9. PCRE-8.34: build and security fixes for MariaDB-10.0.9.

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

  • Property mode set to 100644
File size: 13.4 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 mariadb-download-http "http://tweedo.com/mirror/mariadb/mariadb-&mariadb-version;/kvm-tarbake-jaunty-x86/mariadb-&mariadb-version;.tar.gz">
8 <!ENTITY mariadb-download-ftp "ftp://mirrors.fe.up.pt/pub/mariadb/mariadb-&mariadb-version;/kvm-tarbake-jaunty-x86/mariadb-&mariadb-version;.tar.gz">
9 <!ENTITY mariadb-md5sum "36363eaaeace9e81a64ac94d9d53bffe">
10 <!ENTITY mariadb-size "50 MB">
11 <!ENTITY mariadb-buildsize "1.2 GB">
12 <!ENTITY mariadb-time "6.1 SBU (additional 0.4 SBU for the tests)">
13]>
14
15<sect1 id="mariadb" xreflabel="MariaDB-&mariadb-version;">
16 <?dbhtml filename="mariadb.html"?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
23 <title>MariaDB-&mariadb-version;</title>
24
25 <indexterm zone="mariadb">
26 <primary sortas="a-MariaDB">MariaDB</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to MariaDB</title>
31
32 <para>
33 <application>MariaDB</application> is a community-developed fork and a
34 drop-in replacement for the <application>MySQL</application> relational
35 database management system.
36 </para>
37
38 &lfs75_checked;
39
40 <bridgehead renderas="sect3">Package Information</bridgehead>
41 <itemizedlist spacing="compact">
42 <listitem>
43 <para>
44 Download (HTTP): <ulink url="&mariadb-download-http;"/>
45 </para>
46 </listitem>
47 <listitem>
48 <para>
49 Download (FTP): <ulink url="&mariadb-download-ftp;"/>
50 </para>
51 </listitem>
52 <listitem>
53 <para>
54 Download MD5 sum: &mariadb-md5sum;
55 </para>
56 </listitem>
57 <listitem>
58 <para>
59 Download size: &mariadb-size;
60 </para>
61 </listitem>
62 <listitem>
63 <para>
64 Estimated disk space required: &mariadb-buildsize;
65 </para>
66 </listitem>
67 <listitem>
68 <para>
69 Estimated build time: &mariadb-time;
70 </para>
71 </listitem>
72 </itemizedlist>
73
74 <bridgehead renderas="sect3">MariaDB Dependencies</bridgehead>
75
76 <bridgehead renderas="sect4">Required</bridgehead>
77 <para role="required">
78 <xref linkend="cmake"/> and
79 <xref linkend="openssl"/>
80 </para>
81
82 <bridgehead renderas="sect4">Recommended</bridgehead>
83 <para role="recommended">
84 <xref linkend="libevent"/>
85 </para>
86
87 <bridgehead renderas="sect4">Optional</bridgehead>
88 <para role="optional">
89 <xref linkend="boost"/>,
90 <xref linkend="libxml2"/>,
91 <xref linkend="linux-pam"/>,
92 <xref linkend="pcre"/>,
93 <xref linkend="unixodbc"/>,
94 <xref linkend="valgrind"/>,
95 <ulink url="http://packages.debian.org/source/sid/libaio">libaio</ulink>,
96 <ulink url="http://sourceforge.net/projects/judy/">Judy</ulink>,
97 <ulink url="http://sphinxsearch.com/downloads/">Sphinx</ulink>, and
98 <ulink url="http://www.tokutek.com/products/mysql-download-for-mysql-mariadb/">TokuDB</ulink>
99 </para>
100
101 <para condition="html" role="usernotes">User Notes:
102 <ulink url="&blfs-wiki;/mariadb"/>
103 </para>
104
105 </sect2>
106
107 <sect2 role="installation">
108 <title>Installation of MariaDB</title>
109
110 <note>
111 <para>
112 This version of <application>MariaDB</application> is a development
113 release. The BLFS staff has determined that it provides a stable program
114 and includes backported features from <application>MySQL</application>
115 5.6 and entirely new features not found anywhere else. To find the
116 current stable release, please refer to the <ulink
117 url="https://mariadb.org/">MariaDB home page</ulink>.
118 </para>
119 </note>
120
121 <para>
122 For security reasons, running the server as an unprivileged user
123 and group is strongly encouraged. Issue the following (as
124 <systemitem class="username">root</systemitem>) to create the
125 user and group:
126 </para>
127
128<screen role="root"><userinput>groupadd -g 40 mysql &amp;&amp;
129useradd -c "MySQL Server" -d /srv/mysql -g mysql -s /bin/false -u 40 mysql</userinput></screen>
130
131 <para>
132 Install <application>MariaDB</application> by running the
133 following commands:
134 </para>
135
136<screen><userinput>sed -i "s@data/test@\${INSTALL_MYSQLTESTDIR}@g" sql/CMakeLists.txt &amp;&amp;
137sed -i "s/srv_buf_size/srv_sort_buf_size/" storage/innobase/row/row0log.cc &amp;&amp;
138mkdir build &amp;&amp;
139cd build &amp;&amp;
140cmake -DCMAKE_BUILD_TYPE=Release \
141 -DCMAKE_INSTALL_PREFIX=/usr \
142 -DINSTALL_DOCDIR=share/doc/mysql \
143 -DINSTALL_DOCREADMEDIR=share/doc/mysql \
144 -DINSTALL_MANDIR=share/man \
145 -DINSTALL_MYSQLSHAREDIR=share/mysql \
146 -DINSTALL_MYSQLTESTDIR=share/mysql/test \
147 -DINSTALL_PLUGINDIR=lib/mysql/plugin \
148 -DINSTALL_SBINDIR=sbin \
149 -DINSTALL_SCRIPTDIR=bin \
150 -DINSTALL_SQLBENCHDIR=share/mysql/bench \
151 -DINSTALL_SUPPORTFILESDIR=share/mysql \
152 -DMYSQL_DATADIR=/srv/mysql \
153 -DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock \
154 -DWITH_EXTRA_CHARSETS=complex \
155 -DTOKUDB_OK=0 \
156 .. &amp;&amp;
157make</userinput></screen>
158
159 <para>
160 To test the results, issue: <command>make test</command>.
161 </para>
162
163 <para>
164 Now, as the <systemitem class="username">root</systemitem> user:
165 </para>
166
167<screen role="root"><userinput>make install</userinput></screen>
168
169 </sect2>
170
171 <sect2 role="commands">
172 <title>Command Explanations</title>
173
174 <para>
175 <command>sed -i ...</command>: First sed sets correct installation
176 directory for some components. Second sed fixes a bug in the code.
177 </para>
178
179 <para>
180 <parameter>-DWITH_EXTRA_CHARSETS=complex</parameter>: This switch enables
181 support for the complex character sets.
182 </para>
183
184 <!-- Manually-specified variables were not used by the project: WITH_LIBEVENT
185 <para>
186 <parameter>-DWITH_LIBEVENT=system</parameter>: This switch is used to
187 tell the build system to use installed <application>libevent</application>.
188 Remove it if you didn't install <application>libevent</application>.
189 </para> -->
190
191 <para>
192 <option>-DWITHOUT_SERVER=ON -DWITH_UNIT_TESTS=OFF</option>: Use these
193 switches if you don't want the server and would like to build the client
194 only.
195 </para>
196
197 <para>
198 <option>-DWITH_EMBEDDED_SERVER=ON</option>: This switch enables compiling
199 the embedded server library needed by certain applications, such as
200 <application>Amarok</application>.
201 </para>
202
203 <note><para>
204 There are numerous options available to <command>cmake</command>. Check
205 the output of the <command>cmake . -LH</command> for additional
206 customization options.
207 </para></note>
208
209
210 </sect2>
211
212 <sect2 role="configuration">
213 <title>Configuring MySQL</title>
214
215 <sect3 id="mariadb-config">
216 <title>Config Files</title>
217
218 <para>
219 <filename>/etc/mysql/my.cnf</filename> and
220 <filename>~/.my.cnf</filename>
221 </para>
222
223 <indexterm zone="mariadb mariadb-config">
224 <primary sortas="e-AA.my.cnf">~/.my.cnf</primary>
225 </indexterm>
226
227 <indexterm zone="mariadb mariadb-config">
228 <primary sortas="e-etc-mysql-my.cnf">/etc/mysql/my.cnf</primary>
229 </indexterm>
230
231 </sect3>
232
233 <sect3>
234 <title>Configuration Information</title>
235
236 <para>
237 Create basic <filename>/etc/mysql/my.cnf</filename>
238 using the following command as the <systemitem
239 class="username">root</systemitem> user:
240 </para>
241
242<screen role="root"><userinput>install -v -dm 755 /etc/mysql &amp;&amp;
243cat &gt; /etc/mysql/my.cnf &lt;&lt; "EOF"
244<literal># Begin /etc/mysql/my.cnf
245
246# The following options will be passed to all MySQL clients
247[client]
248#password = your_password
249port = 3306
250socket = /run/mysqld/mysqld.sock
251
252# The MySQL server
253[mysqld]
254port = 3306
255socket = /run/mysqld/mysqld.sock
256datadir = /srv/mysql
257skip-external-locking
258key_buffer_size = 16M
259max_allowed_packet = 1M
260sort_buffer_size = 512K
261net_buffer_length = 16K
262myisam_sort_buffer_size = 8M
263
264# Don't listen on a TCP/IP port at all.
265skip-networking
266
267# required unique id between 1 and 2^32 - 1
268server-id = 1
269
270# Uncomment the following if you are using BDB tables
271#bdb_cache_size = 4M
272#bdb_max_lock = 10000
273
274# Uncomment the following if you are using InnoDB tables
275#innodb_data_home_dir = /srv/mysql
276#innodb_data_file_path = ibdata1:10M:autoextend
277#innodb_log_group_home_dir = /srv/mysql
278# You can set .._buffer_pool_size up to 50 - 80 %
279# of RAM but beware of setting memory usage too high
280#innodb_buffer_pool_size = 16M
281#innodb_additional_mem_pool_size = 2M
282# Set .._log_file_size to 25 % of buffer pool size
283#innodb_log_file_size = 5M
284#innodb_log_buffer_size = 8M
285#innodb_flush_log_at_trx_commit = 1
286#innodb_lock_wait_timeout = 50
287
288[mysqldump]
289quick
290max_allowed_packet = 16M
291
292[mysql]
293no-auto-rehash
294# Remove the next comment character if you are not familiar with SQL
295#safe-updates
296
297[isamchk]
298key_buffer = 20M
299sort_buffer_size = 20M
300read_buffer = 2M
301write_buffer = 2M
302
303[myisamchk]
304key_buffer_size = 20M
305sort_buffer_size = 20M
306read_buffer = 2M
307write_buffer = 2M
308
309[mysqlhotcopy]
310interactive-timeout
311
312# End /etc/mysql/my.cnf</literal>
313EOF</userinput></screen>
314
315 <para>
316 You can now install a database and change the ownership to the
317 unprivileged user and group (perform as the <systemitem
318 class="username">root</systemitem> user):
319 </para>
320
321<screen role="root"><userinput>mysql_install_db --basedir=/usr --datadir=/srv/mysql --user=mysql &amp;&amp;
322chown -R mysql:mysql /srv/mysql</userinput></screen>
323
324 <para>
325 Further configuration requires that the
326 <application>MariaDB</application> server is running. Start
327 the server using the following commands as the <systemitem
328 class="username">root</systemitem> user:
329 </para>
330
331<screen role="root"><userinput>install -v -m755 -o mysql -g mysql -d /run/mysqld &amp;&amp;
332mysqld_safe --user=mysql 2&gt;&amp;1 &gt;/dev/null &amp;</userinput></screen>
333
334 <para>
335 A default installation does not set up a password for the
336 administrator, so use the following command as the <systemitem
337 class="username">root</systemitem> user to set one. Replace
338 <replaceable>&lt;new-password&gt;</replaceable> with your own.
339 </para>
340
341<screen role="root"><userinput>mysqladmin -u root password <replaceable>&lt;new-password&gt;</replaceable></userinput></screen>
342
343 <para>
344 Configuration of the server is now finished. Shut the server
345 down using the following command as the <systemitem
346 class="username">root</systemitem> user:
347 </para>
348
349<screen role="root"><userinput>mysqladmin -p shutdown</userinput></screen>
350
351 </sect3>
352
353 <sect3 id="mariadb-init">
354 <title>Boot Script</title>
355
356 <para>
357 Install the <filename>/etc/rc.d/init.d/mysql</filename> init script
358 included in the <xref linkend="bootscripts"/> package as
359 the <systemitem class="username">root</systemitem> user to start the
360 <application>MariaDB</application> server during system boot-up.
361 </para>
362
363 <indexterm zone="mariadb mariadb-init">
364 <primary sortas="f-mysql">mysql</primary>
365 </indexterm>
366
367<screen role="root"><userinput>make install-mysql</userinput></screen>
368
369 </sect3>
370
371 </sect2>
372
373 <sect2 role="content">
374 <title>Contents</title>
375
376 <segmentedlist>
377 <segtitle>Installed Programs</segtitle>
378 <segtitle>Installed Libraries</segtitle>
379 <segtitle>Installed Directories</segtitle>
380
381 <seglistitem>
382 <seg>
383 aria_chk, aria_dump_log, aria_ftdump, aria_pack, aria_read_log,
384 innochecksum, msql2mysql, myisamchk, myisam_ftdump, myisamlog,
385 myisampack, my_print_defaults, mysql, mysqlaccess,
386 mysqladmin, mysqlbinlog, mysqlbug, mysqlcheck, mysql_client_test,
387 mysql_client_test_embedded, mysql_config,
388 mysql_convert_table_format, mysqld, mysqld_multi, mysqld_safe, mysqldump,
389 mysqldumpslow, mysql_embedded, mysql_find_rows, mysql_fix_extensions,
390 mysqlhotcopy, mysqlimport, mysql_install_db, mysql_plugin,
391 mysql_secure_installation, mysql_setpermission, mysqlshow, mysqlslap,
392 mysqltest, mysqltest_embedded, mysql_tzinfo_to_sql, mysql_upgrade,
393 mysql_waitpid, mysql_zap, mytop, perror, replace, resolveip,
394 resolve_stack_dump, and tokuftdump
395 </seg>
396 <seg>
397 libmysqlclient.{so,a}, libmysqlclient_r.{so,a},
398 <!-- libmysqld.{so,a},--> and libmysqlservices.a,
399 and several under /usr/lib/mysql/plugin/
400 </seg>
401 <seg>
402 /etc/mysql,
403 /srv/mysql,
404 /usr/include/mysql,
405 /usr/lib/mysql,
406 /usr/share/doc/mysql, and
407 /usr/share/mysql
408 </seg>
409 </seglistitem>
410 </segmentedlist>
411
412 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
413
414 <para>
415 Descriptions of all the programs and libraries would be several
416 pages long. Instead, consult the man pages
417 or the online documentation at <ulink
418 url="https://mariadb.com/kb/en/mariadb-documentation/"/>.
419 </para>
420
421 <para>
422 The <application>Perl</application> DBI modules must be installed
423 for some of the <application>MariaDB</application> support programs to
424 function properly.
425 </para>
426
427 </sect2>
428
429</sect1>
Note: See TracBrowser for help on using the repository browser.