Comments - How to include "mariadb-dump" in the build? Best practices for backup?

5 months, 2 weeks ago Vladislav Vaintroub

You're asking many questions at once :)

My cmake command line is quite similar to yours, just I'd not build in the source directory, but anyway

In the build directory, this line

cmake --build . --target mariadb-dump

Will build your the mariadb-dump, starting maybe with 10.5 (before that, target was called mysqldump). Maybe you build an old version.

You can't exclude mariadb-dump from the build using CMake during configure step, there are no options for it.

 
5 months, 2 weeks ago John Doe

Just wanted to clarify exactly how I do it currently (for MariaDB):

cd ~
wget https://archive.mariadb.org/mariadb-11.4.2/source/mariadb-11.4.2.tar.gz
tar -xf mariadb-*.tar.gz
cd mariadb-11.4.2

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

cmake --build .
sudo cmake --install .

So if I want to also build the "mariadb-dump", I should change the last two lines to this:

cmake --build .
cmake --build . --target mariadb-dump
sudo cmake --install .

Is this what you mean?

 
5 months, 2 weeks ago Vladislav Vaintroub

Not, not exactly what I meant.

I mean, if I do the same as you do, then after then cmake --build , there is a client/mariadb-dump already, and if I install with

cmake --install . --prefix my_prefix

then run

my_prefix/bin/mariadb-dump --help

it does what it should do, namely, output usage and various variables it accepts.

I'm saying it works for me, because I just ran this sequence. I could recommend passing -j<number_of_cpus> to the cmake --build , to shorten the build time.

 
5 months, 2 weeks ago John Doe

Ahaaaaaaa! I understand it now!

The "mariadb-dump" is already installed. On my system, MariaDB is installed to "/usr/local/mysql".

And if i run

/usr/local/mysql/bin/mariadb-dump

This will start the "mariadb-dump". I did not know it's inside the installation directory!

So it looks like I do not need to reinstall anything, which is nice.

By the way, I just wonder: If I want to completely uninstall/reinstall MariaDB in the future after building manually, what is the best way?

I just do:

<<code>> sudo rm -rf /usr/local/mysql <</code>

Or I need to do something else, to make a complete uninstall?

Thank you so much!

 
5 months, 2 weeks ago Vladislav Vaintroub

I think your "rm -rf" should be fine. cmake --install did not create anything outside of that directory.

You need to decide where you'll create data directory with mariadb-install-db, and then decide whether to remove or retain when you uninstall like that, there is no automatisms for that, with "cmake --install"

 
5 months, 2 weeks ago John Doe

Thank you so much Vladislav, you helped me a lot! I was trying to figure out for 8 hours how to include "mariadb-dump" in the installation. It turns out I already had it - haha!

Now I will go continue working on my script to automate database backups with it. I will also try "mariabackup" and compare it, but I think it will be too large for my email attachment.

Thanks a lot and have a nice day!

 
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.