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