MariaDB 10.4 portable in your USB

Posted by in Databases, MariaDB

In previous entries we have discussed how to have MySQL 8 portable, in addition to the option of using XAMP to also have MariaDB also portable (in previous versions it was MySQL the version included in XAMPP).

Download MariaDB

You must go to https://downloads.mariadb.org/ and select the last version for downloading (or the one you need). In my case, the last version of June 2020 is 10.4.13.

Descargar MariaDB 10.4

You need to access to View All MariaDB Releases, because the version I need to download it is not the direct link.

MariaDB All releases

Click on the option for 10.4.13:

Download the 64 bits and Zip

In my case, I downloaded the 64 bits versions, although you have also available the 32 bits version. Unzip the file (in my case d:mariadb). You have everything almost ready …. almost!

The first start … and abort

If you try to execute the server after unzipping the MariaDB server, you can notice that the server won’t start:

Aborting … the starting of MariaDB

If you have chosen a MariaDB version previous to 10.4.3, you won’t have this error, because by default, you have a database created available (as you can read in the official documentation of MariaDB). From this version and on, you need to execute the command: mysql_install_db, for installing everything you need to start the server.

Mariadb_install_db

There is a fundamental reason for this change, and that is that it is easy to modify the “engine” of MariaDB without seeing any altered data, and thus be able to include your configuration and databases directly.

Before starting to work, it is important to initialize the MariaDB server with the correct configuration. As with MySQL 8, we prepare a small initial configuration file, which is the same, but adjusting the directories:

my.ini forMariaDB

Now, you can start the server with this command:

d:mariadb\bin\mysqld.exe –console


And now, the server is ready to use:

MariaDb ready

Starting script for MariaDB

Exactly as I did with MySQL 8, let’s use the same scripts but modified for MariaDb:

d:mariadb\bin\mysqld.exe –console

Let’s save this as start.bat for having a quick start.

And now, it is time to verify that the server is running:

And with this, I have already told you how to have available in USB both MariaDb and MySQL 8..

Happy coding!