MariaDB

dev-db/mariadb


Source Repository:No results
http://mariadb.org/

Summary: An enhanced, drop-in replacement for MySQL

News

Drobbins

Ego-2.2.0 Released

Ego 2.2.0 released - see this link for more info.
2017-10-18 by Drobbins
Drobbins

Latest Innovations

This news item documents the latest innovations now available under Funtoo Linux.
2017-09-07 by Drobbins
Oleg
2017-08-25 by Oleg
More...

MariaDB

Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

MariaDB is a drop in replacement for MySQL.

Mariadb's executable is /usr/bin/mysql

Mariadb's init script is /etc/init.d/mysql

Installation

# emerge dev-db/mariadb

First Run & Lock Down

Mariadb requires configuration upon instillation.

To deploy Mariadb:

# emerge --config dev-db/mariadb

# rc-service mysql restart
# mysql_secure_installation

Binary logs

The binary logs are used for database replication and they are enabled by default in /etc/mysql/mariadb.d/50-distro-server.cnf:

50-distro-server.cnf
[mysqld]
log-bin

One can disable binary logs by creating custom configuration file under /etc/mysql/mariadb.d/ and name it e.g. 75-local.cnf with content:

75-local.cnf
[mysqld]
skip-log-bin

The status of the binary logs can be inspected by the dev-db/phpmyadmin (package not on wiki - please add) or by the SQL command:

(sql source code) - Show binary logs
SHOW BINARY LOGS;

Binary log can be all removed:

(sql source code) - Reset binary logs
RESET MASTER;
Warning

Use RESET MASTER only if you don't use replication at all or if the server is configured as master first time!

Unmaintained binary log files will grow in count and size and they can consume considerable disk space (in my case it was more than 2 GB). Then one can purge old files by the PURGE BINARY LOGS SQL command. It can be used in two manners:

(sql source code) - Remove logs older than given file
PURGE BINARY LOGS TO 'mariadb-bin.000036';
(sql source code) - Remove logs older than given date
PURGE BINARY LOGS BEFORE '2017-08-24 11:13';
Tip

Purging old logs can be automated by the expire-logs-days configuration option, with number of days to keep logs.

Log's file name can be configured by the log-basename or log-bin options. If not configured, the default mariadb-bin with numbered extension will be used.

Note

The default (unconfigured) log's file name was changed in time. The older MariaDB versions was using mysql-bin and even older setups was using hostname in name. It is safe to remove the old files, because they are not used by server more.

External Resources

see: Package:MySQL