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