Setup and Configuration MariaDB (Debian/Ubuntu)
Introduction
To use Pathfinder with the open-source MariaDB database system, a first-time installation and configuration must be completed. This process consists of the following steps:
Download and install the MariaDB package
Perform initial MariaDB configuration
Create a database and user for Pathfinder
Configure external access
Apply optional settings
Step 1 – Download and Install MariaDB
Step 1.1 – Install via Package Sources (Online)
Before installation, verify that a current version of mariadb-server
is available in the system’s package sources by running the following command:
sudo apt list mariadb-server
If no current package is available for the distribution, or if it is outdated, proceed with the alternative method in Step 1.2.
To install the package, run:
sudo apt install mariadb-server
Confirm the installation with y
when prompted. Installation time may vary based on server performance and network speed.
Tip: On systems with a graphical interface, a package manager may also be used to check the available MariaDB versions.
Step 1.2 – Manual Installation via Website (Offline/Alternative)
If no suitable package is available via the distribution's repositories, the latest version of MariaDB can be downloaded manually from the official website.
Refer to the official documentation for instructions:
🔗 https://mariadb.com/kb/en/installing-mariadb-deb-files/
After installation, continue with Step 2.
Step 2 – Initial Configuration of MariaDB
Once installed, secure the MariaDB instance using the built-in setup tool:
sudo mysql_secure_installation
This interactive script assists with the following tasks:
Set a root password
Remove anonymous users
Disallow root login from remote machines
Remove the default test database
After completion, access the MariaDB shell:
sudo mariadb
Authentication may be required. A prompt will appear: MariaDB>
Step 3 – Create Database and User for Pathfinder
Create an empty database by entering the following command in the MariaDB prompt. Replace DB_NAME
with the desired name:
create database DB_NAME;
Next, create a non-root user account for Pathfinder to access the database:
grant all privileges on DB_NAME.* TO 'USER_NAME'@'%' identified by 'PASSWORD';
Replace DB_NAME
, USER_NAME
, and PASSWORD
with appropriate values. These credentials will later be used to configure Pathfinder’s database connection.
Apply the changes and exit the shell:
flush privileges; exit;
Step 4 – Configure External Access
To allow remote access to the MariaDB server, adjust the IP binding in the server configuration file. Open the following file:
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
Locate the line:
bind-address = 127.0.0.1
Change 127.0.0.1
to the actual IP address of the server.
Step 5 – Additional Configuration (Optional)
Firewall Configuration
MariaDB listens on port 3306
by default. If a firewall is enabled on the server, ensure that this port is open to allow connections from Pathfinder.
Handling Large Document Files in the Database
Pathfinder allows files to be linked or directly stored in the database. By default, MariaDB supports file sizes up to 16 MB.
To increase the allowed file size, update the max_allowed_packet
value in the MariaDB configuration:
sudo mariadb
Then execute the following command within the MariaDB prompt (replace SIZE
with the desired value in bytes):
set global max_allowed_packet=SIZE;
Example for 32 MB:
set global max_allowed_packet=33554432;
Conclusion
MariaDB has now been successfully installed and configured. The database is ready to be connected to Pathfinder. For the next steps, refer to Configure the Client-Database Connection.