Will
April 12, 2023, 1:49am
1
After my video last week on what I am self hosting:
I had a few people ask about my database backup script. I am going to do an upcoming video on it, but because I need to add the code somewhere, so I made a write up on www.spacerex.co ! Write up here:
Databases like MySQL and MariaDB can get corrupted pretty easily, due to the fact that much of the database is stored in RAM, so a hard crash can leave entire tables completely corrupted. This is something I know first hand from experience. A disk...
Est. reading time: 4 minutes
Let me know what you think & if this still needs a video!
Steve
July 16, 2023, 3:41am
2
Hi Will,
Presumably you use Mariaa.db as a general database for many applications.
Could you give:
a run down of how you do this
what applications you are targeting to the DB
how you configure the applications to use the DB
Using a single DB definitely interests me - just not sure how to do it.
Also - where do you host the DB? Synology?
Do you have any pointers to tutorials?
Cheers
Steve
h3li0
October 11, 2023, 5:17pm
3
also interested in this topic - I’m just starting into the NAS world having received my DS923+ a couple of days ago.
I definitely want to use a single db for all the applications that I’m considering running with docker, so definitely a tutorial around this would be greatly appreciated * winking at @Will *
raphh
June 7, 2024, 8:18pm
4
Same as you @Steve and @h3li0 , also interested in this topic after I saw your video and saw database was the first topic you mentioned.
I think a full video on this topic would be very useful for a lot of us
Maybe you guys find any info on this topic since then?
Steve
June 12, 2024, 7:18am
5
Some updates on what Will has posted.
Step 1 - Creating the Backup User
CREATE USER ‘backupuser’@‘localhost’ IDENTIFIED BY ‘password’;
GRANT LOCK TABLES, SELECT, SHOW VIEW, PROCESS ON . TO ‘backupuser’@‘localhost’;
FLUSH PRIVILEGES;
EXIT;
There are 2 ways to backup MariaDB:
Using mariadb-dump & mysqldump – The mariadb-dump utility is the newer name for mysqldump, though you can still run it using either name.
Using mariadb-backup
This guide uses MySQLDump - Making Backups with mariadb-dump
Here are some other links on MariaDB backup using different methods:
Cheers
1 Like
Sorry for grave digging, but i use this
Script dumps all MySQL (or MariaDB) databases to separate SQL files (compressed to .sql.gz) named with timestamp. It also removes old backups (older than specified amount of days).
It works perfectly fine on DSM