source: server/databases/mariadb.xml@ 9ea70da

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 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 9ea70da was 9ea70da, checked in by Bruce Dubbs <bdubbs@…>, 9 years ago

Update to libva-1.5.1 / libva-intel-driver-1.5.1.
Update to xf86-input-wacom-0.29.0.
Update to udisks-2.1.5.
Update to seahorse-3.14.1.
Update to mariadb-10.0.17

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

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