source: server/databases/mariadb.xml@ 48953ef

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 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 48953ef was 48953ef, checked in by Igor Živković <igor@…>, 10 years ago

update to mariadb-10.0.6

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

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