facebook youtube pinterest twitter reddit whatsapp instagram

Changing the MariaDb Configuration Files

You can tune MariaDB to your liken using the MariaDB’s option files.

The default MariaDB option file is called my.cnf on Unix-like operating systems (i.e Ubuntu, Debian, and the likes), if you are used to MySQL, then this shouldn’t be new to you, the config file can be used to change a lot, e.g the buffer sizes, the max_upload size, and more.

The config files are located in the /etc/mysql, change to the directory by executing cd /etc/mysql

This would list the following files:

drwxr-xr-x  2 root root 4096 Jun 24 10:50 conf.d
-rw-------  1 root root  277 Jun 24 10:50 debian.cnf
-rwxr-xr-x  1 root root 1509 Jan 30 07:25 debian-start
-rw-r--r--  1 root root  869 Jan 30 07:25 mariadb.cnf
drwxr-xr-x  2 root root 4096 Jun 24 10:50 mariadb.conf.d
lrwxrwxrwx  1 root root   24 Jun 24 10:50 my.cnf -> /etc/alternatives/my.cnf
-rw-r--r--  1 root root  839 Aug  3  2016 my.cnf.fallback

To configure MariaDB to run the way you want, you may consider creating a new configuration file with the .cnf extension, although this isn’t a requirement, to actually get started you might want to understand how MariaDB reads the config file, this instruction is located in the mariadb.conf The MariaDB tools read configuration files in the following order:

  • "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
  • "/etc/mysql/conf.d/*.cnf" to set global options.
  • "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
  • "~/.my.cnf" to set user-specific options.

Note: If the same option is defined multiple times, the last one will apply.

If you want to adjust or tune the config of your MariaDB, simply edit it in the conf.d directory, e.g

sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

Related Post(s)

  • Monitoring Multiple Log Files In RealTime With MultiTail (Ubuntu)

    Oh my... I really find scanning through the logs file time consuming, and painful. Luckily for me, I founded Multitail, which is an awesome, and powerful tool for not only browsing through several f

  • How To Find Files Using Locate in Ubuntu

    It's kind of frustrating when you are searching for a particular file, and you have no idea of how to find it, In this guide, I'll walk you through on two different ways you can find a file in your G

  • Managing MariaDB Databases (Ubuntu Server)

    In this guide, you'll learn how to manage MariaDB databases in your terminal, from connecting to the database server using the mariadb command, creating a database, removing (drop) database, and mana

  • Transferring files with scp In [Ubuntu]

    I recently wrote a basic guide on transferring files with rsync, and I outlined some examples, while rsync is really powerful, the major problem I have with it is that it doesn't support the transfer

  • Transferring files with rsync In [Ubuntu]

    If you are coming from a GUI world, then you know transferring files from one location or folder to another is as easy as doing a few mouse clicks, the way it works in GNU/Linux is a bit different, a

  • How to Rename Files and Directories in GNU/Linux

    Renaming file and directory is quite straight forward in GNU/Linux, in this guide I'll show you how to do just that... The mv command is among the useful utility for renaming, and moving files from o