Comments - How to include "mariadb-dump" in the build? Best practices for backup?
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.
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.
Just wanted to clarify exactly how I do it currently (for MariaDB):
So if I want to also build the "mariadb-dump", I should change the last two lines to this:
Is this what you mean?
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.
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
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!
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"
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!