source: server/databases/mariadb.xml@ 077d95b

10.0 10.1 11.0 7.10 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind ken/refactor-virt lazarus nosym perl-modules qt5new trunk xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 077d95b was 077d95b, checked in by Fernando de Oliveira <fernando@…>, 6 years ago
  • Tcsh-6.19.00: typo.
  • MariaDB-10.0.21 and SDL-1.2.15: Fix dead URLs.

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

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