Comments - Bare-minimum MariaDB "cmake" options?

5 months 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 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 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 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.