MariaDB is an enhanced, drop-in MySQL replacement.
USE flags for dev-db/mariadb An enhanced, drop-in replacement for MySQL
||Build mariadb-backup which supports SST and hot backup of InnoDB, Aria and MyISAM including compression and encryption|
||Flag to enable or disable options for prebuilt (GRP) packages (eg. due to licensing issues)|
||Add support for alternative storage engines (Archive, CSV, Blackhole, Federated(X), Partition)|
||Enables galera replication|
||Enables lz4 compression methods for InnoDB/XtraDB|
||Enables lzo compression methods for InnoDB/XtraDB|
||Enables snappy compression methods for InnoDB/XtraDB using app-arch/snappy|
||Enable the CONNECT engine to access foreign databases via JDBC|
||Use LATIN1 encoding instead of UTF8|
||Enable SSL connections and crypto functions using dev-libs/libressl|
||Add support for the Mroonga engine for interfacing with the Groonga text search|
||Enable NUMA support using sys-process/numactl (NUMA kernel support is also required)|
||Add support for the Open Query GRAPH engine|
||Enable the optional PAM authentication plugin for the server|
||Add support for statement profiling (requires USE=community).|
||Add support for RocksDB; a key/value, LSM database optimized for flash storage|
||Build the server program|
||Add suport for the sphinx full-text search engine|
||Add tools needed to support the mariabackup SST method|
||Add tools needed to support the rsync SST method|
||Build support for profiling and tracing using dev-util/systemtap|
||Install upstream testsuites for end use.|
||Add support for TokuDB storage engine|
||Enable SSL connections and crypto functions using the bundled yaSSL|
emerge --ask mariadb
To have MariaDB started automatically at boot, add it to the default runlevel:
rc-update add mysql default
If MariaDB is configured, start the service:
rc-service mysql start
- With MariaDB < 10.1
systemctl enable mysqld.service
- With MariaDB >= 10.1.8
systemctl enable mariadb.service
MariaDB 10.1.8 includes a unit named mariadb.service that uses notify instead of a script to check if the system is alive.
Gentoo MariaDB package maintainers will help you set up MariaDB through the configuration option in the ebuild.
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).
When configuring MariaDB on a system with 'localhost' as its hostname, the "Your machine must NOT be named localhost" error is produced. The following steps will allow configuration by changing the hostname.
In the event MariaDB configuration fails due to 'localhost' as hostname, update the system hostname variable to a name other than 'localhost' in /etc/conf.d/hostname:
sed -i 's/localhost/larry/g' /etc/conf.d/hostname
Restart the hostname service:
rc-service hostname restart
Then, run the configuration command:
emerge --config dev-db/mariadb
When the database is set up and running, connect to MariaDB using the mysql client application.
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)]>
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.
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.
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.
- MySQL/Startup Guide — outlines basic instructions for users on setting up and using MySQL on Linux.
- PostgreSQL — a free and open source relational database management system (RDBMS).