Comments - Bare-minimum MariaDB "cmake" options?

5 months, 1 week ago Daniel Black

Simplest way to get a working production system is using existing ARM64 Debian packages.

In addition to the 10.11 packages are part of Debian, newer version are available as repositories obtained from:

https://mariadb.org/download/?t=repo-config&d=Debian+12+%22Bookworm%22&v=11.2

11.2 has stable releases now, but if you want a series with bug fixes that is going to continue for as long as Debian 12 recommend sticking to the 10.11 LTS release.

Generally packages are a little more inclusive than a bare minimal, they include plugins that are DYNAMIC but not installed, and for those plugins that require additional dependencies those are separate.

For a minimal build you can take any PLUGIN_X=DYNAMIC and add that to the =NO list without spending too much time considering what they are.

The "make" equivalent for those that have read the cmake introduction are:

cmake --build .
sudo cmake --install .
 
5 months, 1 week ago Vladislav Vaintroub

bare minimum cmake optiond for me are "-DWITHOUT_DYNAMIC_PLUGINS=1 -DWITH_MARIABACKUP=0" This excludes all server plugins that are built as shared libraries, you do not need to list them individually, as you did. -DWITH_MARIABACKUP=0 excludes mariabackup, in case you do not need it. You can add -DPLUGIN_PERFSCHEMA=NO, if you do not need performance schema (this is not built as shared library, thus unaffected by -DWITHOUT_DYNAMIC_PLUGINS)

 
5 months, 1 week ago Vladislav Vaintroub

Also -DWITH_UNIT_TESTS=0 is useful, to avoid spending compile time on unit tests, if you're not going to run them

 
5 months, 1 week ago Bob Sammers

I now installed it using this:

cmake . -DWITHOUT_DYNAMIC_PLUGINS=1 -DWITH_MARIABACKUP=0 -DPLUGIN_PERFSCHEMA=NO -DWITH_UNIT_TESTS=0

cmake --build .
sudo cmake --install . 

But I didn't get any systemd files now (to start as a service). Any clue what might have gone wrong? I can't find any "mysqld.service" file anywhere in fact. How would I be able to actually start the mariadb server now?

 
5 months, 1 week ago Bob Sammers

Thank you all!

Wow, that "-DWITHOUT_DYNAMIC_PLUGINS=1" is just what I need! I couldn't find anything about it, is it undocumented?

So I should be using "cmake --build" instead of "make -j4" (I have 4 vCPU on my server). Will cmake --build be faster? Or what's the difference?

I see so many different guides (even on MariaDB's website) on how to build this from source and it always differs something in the commands. It's a bit confusing, but hopefully I can get it done.

I have seen guides show some "mysql_secure_installation". Is that what I should run once I have built and installed it? Or how should I proceed? (For setting up users with password authentication).

And if I install from source, will there be a systemd service included? So that I can turn on/off MariaDB as I wish? E.g. "systemctl stop mariadb" (or maybe it's mysqld?). Sorry for these questions, but I see so many different approaches to everything.

You both seem like absolute MariaDB experts. I really appreciate your help, it means a lot! You are awesome!

 
5 months ago Daniel Black

Wow, that "-DWITHOUT_DYNAMIC_PLUGINS=1" is just what I need! I couldn't find anything about it, is it undocumented?

DISABLE_SHARED has the same effect and its in the cmake -L options. So I guess it should be the documented one.

So I should be using "cmake --build" instead of "make -j4" (I have 4 vCPU on my server). Will cmake --build be faster? Or what's the difference?

cmake can use multiple things to build. "cmake --build" will work with all of the, but make -j4 will only work if CMAKE_GENERATOR is set to makefiles.

I see so many different guides ...

Many things work. Do tell us if something doesn't.

I have seen guides show some "mysql_secure_installation

Per docs "Note that many of the reasons for the existence of this script no longer apply".

And if I install from source, will there be a systemd service included?

Did you have libsystemd-dev installed when you compiled?

If so, the service file is in /usr/local/mysql/support-files/systemd/mariadb.service

It will need to be copied/linked from /lib/systemd/system/ or /etc/systemd/system for systemd to recognise it. systemctl daemon-reload after its moved there and then systemctl start mariadb.service.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.