source: server/databases/mariadb.xml@ 5ebfb66

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 5ebfb66 was 5ebfb66, checked in by Fernando de Oliveira <fernando@…>, 9 years ago

typo

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

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