MariaDB Knowledge Base Comments for: Bare-minimum MariaDB "cmake" options?https://mariadb.com/kb/en/bare-minimum-mariadb-cmake-options/+comments/feed/en-usThu, 30 Nov 2023 10:21:27 +0000Re: Bare-minimum MariaDB "cmake" options?https://mariadb.com/kb/en/bare-minimum-mariadb-cmake-options/+comments/6507<div style="margin-left:2em"><p> Wow, that "-DWITHOUT_DYNAMIC_PLUGINS=1" is just what I need! I couldn't find anything about it, is it undocumented?</p> </div> <p>DISABLE_SHARED has the same effect and its in the cmake -L options. So I guess it should be the documented one.</p> <div style="margin-left:2em"><p> 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?</p> </div> <p>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.</p> <div style="margin-left:2em"><p> I see so many different guides ...</p> </div> <p>Many things work. Do tell us if something doesn't.</p> <div style="margin-left:2em"><p> I have seen guides show some "mysql_secure_installation</p> </div> <p>Per <a href="/kb/en/mariadb-secure-installation/">docs</a> "Note that many of the reasons for the existence of this script no longer apply".</p> <div style="margin-left:2em"><p> And if I install from source, will there be a systemd service included?</p> </div> <p>Did you have libsystemd-dev installed when you compiled?</p> <p>If so, the service file is in /usr/local/mysql/support-files/systemd/mariadb.service</p> <p>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.</p> Daniel Blackhttps://mariadb.com/kb/en/bare-minimum-mariadb-cmake-options/+comments/6507Re: Bare-minimum MariaDB "cmake" options?https://mariadb.com/kb/en/bare-minimum-mariadb-cmake-options/+comments/6506<p>I now installed it using this:</p> <pre class="fixed">cmake . -DWITHOUT_DYNAMIC_PLUGINS=1 -DWITH_MARIABACKUP=0 -DPLUGIN_PERFSCHEMA=NO -DWITH_UNIT_TESTS=0 cmake --build . sudo cmake --install . </pre><p>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?</p> Bob Sammershttps://mariadb.com/kb/en/bare-minimum-mariadb-cmake-options/+comments/6506Re: Bare-minimum MariaDB "cmake" options?https://mariadb.com/kb/en/bare-minimum-mariadb-cmake-options/+comments/6504<p>Also -DWITH_UNIT_TESTS=0 is useful, to avoid spending compile time on unit tests, if you're not going to run them</p> Vladislav Vaintroubhttps://mariadb.com/kb/en/bare-minimum-mariadb-cmake-options/+comments/6504Re: Bare-minimum MariaDB "cmake" options?https://mariadb.com/kb/en/bare-minimum-mariadb-cmake-options/+comments/6503<p>Thank you all!</p> <p>Wow, that "-DWITHOUT_DYNAMIC_PLUGINS=1" is just what I need! I couldn't find anything about it, is it undocumented?</p> <p>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?</p> <p>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.</p> <p>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).</p> <p>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.</p> <p>You both seem like absolute MariaDB experts. I really appreciate your help, it means a lot! You are awesome!</p> Bob Sammershttps://mariadb.com/kb/en/bare-minimum-mariadb-cmake-options/+comments/6503Re: Bare-minimum MariaDB "cmake" options?https://mariadb.com/kb/en/bare-minimum-mariadb-cmake-options/+comments/6502<p>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)</p> Vladislav Vaintroubhttps://mariadb.com/kb/en/bare-minimum-mariadb-cmake-options/+comments/6502Re: Bare-minimum MariaDB "cmake" options?https://mariadb.com/kb/en/bare-minimum-mariadb-cmake-options/+comments/6501<p>Simplest way to get a working production system is using existing ARM64 Debian packages.</p> <p>In addition to the 10.11 packages are part of Debian, newer version are available as repositories obtained from:</p> <p><a href="https://mariadb.org/download/?t=repo-config&amp;d=Debian+12+%22Bookworm%22&amp;v=11.2">https://mariadb.org/download/?t=repo-config&amp;d=Debian+12+%22Bookworm%22&amp;v=11.2</a></p> <p>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.</p> <p>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.</p> <p>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.</p> <p>The "make" equivalent for those that have read the cmake introduction are:</p> <pre class="fixed">cmake --build . sudo cmake --install . </pre>Daniel Blackhttps://mariadb.com/kb/en/bare-minimum-mariadb-cmake-options/+comments/6501