News
MariaDB MaxScale Load Balancer with Master/Master Replication
For this how-to we were working with a MariaDB 10.6.5 database server and the newest MariaDB MaxScale 6.3.0 (aka 2.6) load balancer/proxy.
As a starting point we had a working MariaDB Master/Master replication with one active Master (Ma) and one passive Master (Mp). Whereas the passive Master was set to read_only. As a replication user we used the user replication.
Creating database accounts for the MaxScale Load Balancer
The MaxScale load balancer connects itself with the application users to the database. …
Taxonomy upgrade extras: Replication Maxscale Load Balancer Proxy Active-Active Master-Master Mariadb
Streaming backup with MariaDB Backup
Because the original MariaDB documentation is a little bit sparse about this topic here are some notes about how to do a streaming MariaDB backup:
# mariadb-backup --user=root --backup --parallel=4 --stream=mbstream | ssh root@target_machine "/usr/bin/mbstream -x -C /var/lib/mysql/"
# mariadb-backup --user=root --prepare --target-dir=/var/lib/mysql
Taxonomy upgrade extras:
FromDual Backup and Recovery Manager for MariaDB and MySQL 2.2.5 has been released
FromDual has the pleasure to announce the release of the new version 2.2.5 of its popular Backup and Recovery Manager for MariaDB and MySQL (brman).
The new FromDual Backup and Recovery Manager can be downloaded from here. The FromDual Repositories were updated. How to install and use the Backup and Recovery Manager is described in FromDual Backup and Recovery Manager (brman) installation guide.
In the inconceivable case that you find a bug in the FromDual Backup and Recovery Manager please report it to the …
Taxonomy upgrade extras: Backup Restore Recovery Pitr Brman Release Bman Rman Fromdual Backup and Recovery Manager
One thought about scaling applications
Are containers so popular because application developers do not know how to write multi-threaded applications well? With containers you can circumvent this problem a bit. You ramp up man single threaded applications in containers and thus get a multi-threaded behaviour.
Databases ARE already multi-threaded. So no need to containerize them.
Taxonomy upgrade extras:
Sharding do-it-yourself
As already mentioned earlier, we roughly have a hand full of customers which are playing with the though of sharding solutions. They typically have many different customers (clients, tenants) and the number of customers becomes so huge (thousands to millions) that one machine cannot cope with the load any more.
So splitting the load by customers to different machines makes sense. This is quite easy when customers are separated per schema. In the good old times of Open Source our customers have implemented …
Taxonomy upgrade extras: Sharding Multi-Tenant
Containers and databases
In the last months we got more and more requests for supporting MariaDB/MySQL/Galera Cluster in (mostly Docker) containers.
Because of its additional layer and added complexity I do not like containers much. Containers are more complicated during troubleshooting and debugging problems.
Other people have already written more than enough about the advantages of containers. What is more difficult to find are the disadvantages of technologies. Thus I focus on those:
Wrong technology?
Container solutions were …
Taxonomy upgrade extras: Container Docker Kubernetes
Sharding solutions
Once in a year or so we get a request of a customer about MariaDB/MySQL sharding solutions. So here we have a list of sharding solutions we are currently aware of:
- MySQL Fabric: A Brief Introduction to MySQL Fabric This product is discontinued by MySQL in the meanwhile!
- Spider Storage Engine for MariaDB: Spider Storage Engine Overview
- MariaDB MaxScale: Simple Sharding with Two Servers and Schema Router
- ProxySQL: Sharding in ProxySQL
- PingCap TiDB (Titan DB): Release Candidate der verteilten Datenbank TiDB …
Taxonomy upgrade extras: Sharding Spider Multi-Tenant
Learning from the Bugs Database
This week I came across an old known issue reported in May 2010: Master/Slave Replication with binlog_format = ROW and tables without a Primary Key is a bad idea! Especially if these tables are huge.
Why this is a bad idea is described in the bug report #53375:
if one runs DML on a table that has no indexes, a full table scan is done. with RBR, the slave might need to scan the full table for each row changed.
The consequence of this behaviour is that the Slave starts lagging. It was further mentioned: …
Taxonomy upgrade extras: Primary Key Replication Row Based Replication (Rbr) Statement Based Replication (Sbr)
MariaDB Deadlocks
We get ever and ever again customer requests concerning Deadlocks. First of all, Deadlocks are usually an application problem, not a database problem! The database itself manifests the application problem with the following message which is sent to the application as an error:
ERROR 1213 (40001): Deadlock found when trying to get lock; try restarting transaction
If your application receives this error message you know where in your application you have a problem. But a deadlock is always a problem between …
Taxonomy upgrade extras: Deadlock
Anonymous PL/SQL block
Is this not just a simple an Anonymous PL/SQL Block?
Taxonomy upgrade extras:
MariaDB Devroom at FOSDEM 2022 CfP is now open
Also in 2022 there will be a FOSDEM (Free and Open source Software Developers’ European Meeting) on 5 and 6 February 2022. This time again online from Brussels (Belgium).
MariaDB has again its own Devroom and the Call for Papers (CfP) is now open for your submissions. We are looking for interesting topics about your daily business, technical presentations, war stories, point of views of management, etc. The deadline for the CfP is before 21 December 2021.
For further information about how to submit a …
Taxonomy upgrade extras: Fosdem 2022 Developer Social Event
MariaDB Connection ID
The MariaDB Connection ID exists since long ago. So why bother about the Connection ID? Because it is interesting and you can do some interesting things with the Connection ID like tracking statements in your connections and find where they come from your application code.
The MariaDB Connection ID is a strictly monotonic increasing number starting with 1 at server restart:
shell> mariadb --user=root --execute='SELECT CONNECTION_ID()<br>G' | grep CONNECTION_ID
CONNECTION_ID(): 2372
shell> …Taxonomy upgrade extras: Connection Max_used_connections General Query Log
GRA_XXX_YYY.log
XXX means Thread ID (= Connection ID) and YYY wsrep transaction sequence number (wsrep_last_committed?):
snprintf(filename, len+1, "%s/GRA_%lld_%lld.log",
wsrep_data_home_dir, (long long) thd->thread_id,
(long long) wsrep_thd_trx_seqno(thd));
Taxonomy upgrade extras:
MariaDB / MySQL Advanced training end of October 2021
From 25 to 29 October 2021 (calendar week 43) we will have another MariaDB / MySQL advanced training in the Linuxhotel in Essen (Germany). The training is in German and will take place on-site (3G!). There are still some places free!
More details about the training you can find here.
Taxonomy upgrade extras:
Cannot find nor guess PID file
In all FromDual tools the rc is unique. So you can easily find where in the code the error happened. In your case it is in lib/myEnv.inc in the function stopInstance.
In the code we check if PID file is empty. And it is empty if it cannot be found:
- in
my.cnfspecified inmyenv.confas variablepid_fileorpid-file - under
$datadir/mysqld.pid - under
$datadir/<hostname>.pid
It would be interesting for us if you could tell us where your PID file is located and where it is configured.
Taxonomy upgrade extras:
Upgrade of Galera Cluster takes more than 1 year
We currently have the situation that a customer cannot upgrade its hyper-consolidated Galera Cluster for more than a year because various different applications cannot, are not willing to or do not have the time to test against the newer version.
What what we suggest here: Create a new Galera Cluster with the new version and move over one project/application after the other to the new Cluster. This reduces complexity. You can do slightly progress and the pressure for the "slow-upgrader" increases over …
Taxonomy upgrade extras:
Automated MariaDB restore tests
Nearly everybody does backups. But nobody needs backups! What everybody wants and needs is a working restore not a working backup…
So how to make sure that your backup is working for the restore? There are a few things you can do already during your backup:
- Check that your backup was running fine. For example by checking the return code of your backup.
- Check the runtime of your backup. If the runtime of your backup significantly changed, it is worth to have a closer look at the backup.
- Check the …
Taxonomy upgrade extras: Backup Restore Brman Fpmmm Monitoring
FromDual Backup and Recovery Manager for MariaDB and MySQL 2.2.4 has been released
FromDual has the pleasure to announce the release of the new version 2.2.4 of its popular Backup and Recovery Manager for MariaDB and MySQL (brman).
The new FromDual Backup and Recovery Manager can be downloaded from here. The FromDual Repositories were updated. How to install and use the Backup and Recovery Manager is described in FromDual Backup and Recovery Manager (brman) installation guide.
In the inconceivable case that you find a bug in the FromDual Backup and Recovery Manager please report it to the …
Taxonomy upgrade extras: Backup Restore Recovery Pitr Brman Release Bman Rman Fromdual Backup and Recovery Manager
MariaDB Foreign Key Constraint example
Foreign Key Constraints are used to model a parent/child relation in an entity relationship (ER) model:

SQL> CREATE TABLE team (
id TINYINT UNSIGNED NOT NULL AUTO_INCREMENT
, name VARCHAR(48) NOT NULL
, PRIMARY KEY (id)
);
SQL> CREATE TABLE employee (
id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT
, first_name VARCHAR(32) NOT NULL
, last_name VARCHAR(64) NOT NULL
, team_id BIGINT UNSIGNED NOT NULL
, PRIMARY KEY (id)
, CONSTRAINT `fk_employee_team` FOREIGN KEY (team_id)
REFERENCES team (id) ON …Taxonomy upgrade extras: Innodb Foreign Key Constraint
Monitoring your MariaDB database with SNMP
Table of Contents
- What is SNMP?
- SNMP Agent (snmptrap)
- SNMP Manager (snmptrapd)
- Test the SNMP Agent
- Creating your own MIB
- Sending MariaDB SNMP traps from PHP
- Literature
What is SNMP?
A customer recently had the question if an how his MariaDB database can be easily monitored with SNMP?
SNMP means Simple Network Management Protocol. It is a widely used and standardized protocol for monitoring the health of network and other devices (including services). In principle you can monitor nearly everything with …
Taxonomy upgrade extras: Snmp Monitoring

