This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.
Please visit our production wiki at https://wiki.gentoo.org
MariaDB
MariaDB An enhanced, drop-in replacement for MySQL.
In Gentoo, dev-db/mariadb is the default package for items that depend on virtual/mysql.
Installation
USE flags
USE flags for dev-db/mariadb An enhanced, drop-in replacement for MySQL
+backup
|
Build mariadb-backup which supports SST and hot backup of InnoDB, Aria and MyISAM including compression and encryption |
+perl
|
Add optional support/bindings for the Perl language |
+server
|
Build the server program |
bindist
|
Flag to enable or disable options for prebuilt (GRP) packages (eg. due to licensing issues) |
columnstore
|
Build the ColumnStore storage engine |
cracklib
|
Support for cracklib strong password checking |
debug
|
Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces |
extraengine
|
Add support for alternative storage engines (Archive, CSV, Blackhole, Federated(X), Partition) |
galera
|
Enables galera replication |
innodb-lz4
|
Enables lz4 compression methods for InnoDB/XtraDB |
innodb-lzo
|
Enables lzo compression methods for InnoDB/XtraDB |
innodb-snappy
|
Enables snappy compression methods for InnoDB/XtraDB using app-arch/snappy |
jdbc
|
Enable the CONNECT engine to access foreign databases via JDBC |
jemalloc
|
Use dev-libs/jemalloc for memory management |
kerberos
|
Add kerberos support |
latin1
|
Use LATIN1 encoding instead of UTF8 |
mroonga
|
Add support for the Mroonga engine for interfacing with the Groonga text search |
numa
|
Enable NUMA support using sys-process/numactl (NUMA kernel support is also required) |
odbc
|
Add ODBC Support (Open DataBase Connectivity) |
oqgraph
|
Add support for the Open Query GRAPH engine |
pam
|
Enable the optional PAM authentication plugin for the server |
profiling
|
Add support for statement profiling (requires USE=community). |
rocksdb
|
Add support for RocksDB; a key/value, LSM database optimized for flash storage |
s3
|
Build the S3 storage engine |
selinux
|
!!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur |
sphinx
|
Add suport for the sphinx full-text search engine |
sst-mariabackup
|
Add tools needed to support the mariabackup SST method |
sst-rsync
|
Add tools needed to support the rsync SST method |
static
|
!!do not set this during bootstrap!! Causes binaries to be statically linked instead of dynamically |
systemd
|
Enable use of systemd-specific libraries and features like socket activation or session tracking |
systemtap
|
Build support for profiling and tracing using dev-debug/systemtap |
tcmalloc
|
Use the dev-util/google-perftools libraries to replace the malloc() implementation with a possibly faster one |
test
|
Install upstream testsuites for end use. |
xml
|
Add support for XML files |
yassl
|
Enable SSL connections and crypto functions using the bundled yaSSL |
Emerge
Install dev-db/mariadb:
root #
emerge --ask mariadb
Service
- OpenRC:
- To have the database(s) started automatically at boot, add it to the default runlevel:
root #
rc-update add mysql default
- If the database is configured, start the service:
root #
rc-service mysql start
- Systemd:
- With MariaDB < 10.1
root #
systemctl enable mysqld.service
- With MariaDB >= 10.1.8
- As of MariaDB 10.1.8, it includes a notify based unit to use instead of a script to check if the system is alive.
root #
systemctl enable mariadb.service
Configuration
Preliminary configuration
Gentoo MariaDB package maintainers will help you set up MariaDB through the configuration option in the ebuild.
root #
emerge --config dev-db/mariadb
The configuration will create a database, set proper permissions, and assist you in creating a secure root password (this is for the MariaDB root account, which is not related to the Linux root account).
In-database configuration
When the database is set up and running, connect to MariaDB using the mysql client application.
user $
mysql -u root -p -h localhost
Enter root password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 86415 Server version: 5.5.32-MariaDB-log Source distribution Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
Custom options
Beginning with MariaDB 10.2, the configuration file my.cnf, includes a single directive to include /etc/mysql/mariadb.d and all files located within. Gentoo includes a file for server settings and one for client settings. Create your own files in this directory and they will be added together in alphabetical order. The base configuration accepts almost all the defaults and only tweaks paths. Tune your server to your liking.
Troubleshooting
Compiling against libmariadb.so
Beginning with MariaDB 10.2, a new LGPL client library is included.
With MariaDB 10.2.8, the server and client headers were separated. This causes compilation errors in some programs which previously relied on server features.
MYSQL_SERVER_VERSION
One example is MYSQL_SERVER_VERSION. A quick fix can be:
#if defined MARIADB_CLIENT_VERSION_STR && !defined MYSQL_SERVER_VERSION #define MYSQL_SERVER_VERSION MARIADB_CLIENT_VERSION_STR #endif
Ultimately, MYSQL_SERVER_VERSION should be removed and use the MYSQL_VERSION_ID integer for version identification.