Part of Datorkirurgen AB – IT experts across Sweden

MariaDB on Linux for businesses: backups, performance, InnoDB settings and troubleshooting of slow queries. We help you in Stockholm and across Sweden.

The database behind most websites

MariaDB and MySQL are currently the most common databases on Linux servers. WordPress, online shops and also many business systems store all their content there. Therefore, you notice immediately when the database becomes slow or stops working. Moreover, MariaDB on Linux is the default in many distributions, for example Debian, AlmaLinux and Amazon Linux. We run the database on our own servers and for clients across Sweden.

The long-term support versions of MariaDB receive updates for several years, and therefore we always choose one of them for production. Right now, many people use 10.11, 11.4 or 11.8, while 12.3 from May 2026 is the latest long-term version. We also keep track of when your version stops receiving fixes. When it is time, we plan an upgrade, and we carry it out with the same care as when we upgraded MariaDB on our own servers.

MariaDB on Linux: cleaning up old packages after an upgrade
MariaDB on Linux: cleaning up old packages after an upgrade. Real output from our own server, where the old packages for version 10.5 are removed.

Backups that actually work

A database without a working backup is a risk that many underestimate. Therefore, we take backups every night with mariadb-dump and the flag --single-transaction. It gives a consistent copy without locking the tables, and as a result the visitors notice nothing. After that, we compress the file and store it with strict permissions. In addition, we send a copy to another location, for example a storage service in the cloud.

The most important thing, however, is to test the restore, since a copy is otherwise just an assumption. We regularly load a backup into a test database and check that everything is there. Only then do we know that the copy really works. For larger databases, we instead use Mariabackup, which copies the files directly and is faster to restore. We choose the method according to the size of the database and how quickly it must be back.

MariaDB on Linux: a backup with mariadb-dump without locking the tables
MariaDB on Linux: a backup with mariadb-dump without locking the tables. Do you need help with Linux? Linux Service helps you in Nacka and Södermalm, on site or remotely.

Performance: the buffer pool and slow queries

The most important setting for performance is innodb_buffer_pool_size, because it decides how much data fits in the memory. If it is too small, the database has to read from disk all the time, and then everything becomes slow. On a dedicated database server, it can be up to 70 per cent of the memory. If the database shares a server with Apache and PHP, however, we choose a lower value.

After that, we look at slow queries, for example those that run thousands of times per hour. We switch on the slow query log and analyse it after a few days. Often we find queries that lack an index or that fetch much more data than they need. A single index can sometimes make a query a hundred times faster. We test every change and measure the effect, so that you see the result.

Checklist for performance in MariaDB on a Linux server
Checklist for performance in MariaDB on a Linux server. An example from our work for clients in Stockholm.

Troubleshooting common errors

Many cases start with the website showing an error about the database connection. The cause may be that MariaDB has stopped, that the disk is full or that the number of connections has run out. First, we read the error log and check the status with systemctl. If the service has crashed, we look for the cause before we restart it. Otherwise, there is a high risk that the same thing happens again.

Another common error is that root cannot sign in, with the message Access denied. In newer versions, root often signs in via the operating system account instead of with a password. Then sudo mariadb works, but signing in with a password does not. In other words, it is not a bug but a security feature. We explain it and set the right permissions for your programs.

Workflow when a website cannot reach its database
Workflow when a website cannot reach its database. Linux Service, part of Datorkirurgen AB, helps businesses across Sweden with servers, scripts and databases.

Security for the database

The database, on the other hand, should never be directly visible to the internet. Therefore, we make sure that it only listens on the local address or on an internal network. In addition, each program gets its own database account with only the permissions it needs. For example, a WordPress account does not need the right to create new users in the database. This limits the damage if a website is hacked.

We also use custom table prefixes in WordPress and strong passwords stored in protected files. We also remove old test databases and anonymous accounts. Finally, we make sure that security updates are installed regularly. More about security in the article on hardening Linux.

Contact Linux Service about MariaDB on Linux

Linux Service is part of Datorkirurgen AB and has worked with databases for more than 30 years. We optimise, back up and troubleshoot MariaDB and MySQL for businesses across Sweden. Information about versions and support periods is available from the MariaDB Foundation.

Therefore, contact us when the database has become slow or when you are unsure about your backups. We carry out a review and propose actions in order of priority. We work remotely, and you always receive a short report. Moreover, we can take over the ongoing operation.

Frequently asked questions about MariaDB on Linux

Questions about MariaDB on Linux

MariaDB: backups and performance

More about troubleshooting and security

Website developed by Datorkirurgen AB · Privacy policy