source: server/databases/mariadb.xml@ 80ee4313

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 80ee4313 was 80ee4313, checked in by Igor Živković <igor@…>, 10 years ago

mariadb fixes

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

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