On 5/11/22 13:22, Jerome Yuzyk via mythtv-users wrote:
> On Wednesday, May 11, 2022 6:38:06 A.M. MDT Hika van den Hoven wrote:
>
>> You can for instance put /var/lib/mysql on its own volume. Thus it
>> cannot flood the system. Also you can mount volumes that do not need
>> writing as read-only.
>
> This is what I'm wanting to know, not to another volume, but not in /var/lib,
> and thought some MythTV Merlin had done it already before I put it on my To
> Research list. Something I'd like to know for other MySQL databases too.
>
> I already do a mythconverg_backup.pl every morning and tuck that away (date-
> stamped) on a couple other machines.
Ignore everything below if you truly want to have *only* the MythTV DB stored
elsewhere and the remaining DB(s) left under /var/lib/mysql or yet another
place.
Stephen had the answer. Here's my (working) configuration. And the steps
I recall doing. Stopped the backend and MySQL before starting.
If you believe in:
https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.pdf, section 5.8.1 suggests /var/lib/mysql is the proper place. I saw the note at
the bottom of page 33 and started in: /srv.
I decided to put ALL MySQL files under /srv/db, maybe /src/mysql would be
more correct:
Create an App Armor local configuration for mysqld:
$ cat /etc/apparmor.d/local/usr.sbin.mysqld
/srv/db/ r,
/srv/db/** rwk,
sudo systemctl restart apparmor.service # I <think> this is required, but
don't remember. Did it in 12/2013.
Update MySQL to look in /srv/db, not /var/lib/mysql:
$ sudo grep --recursive datadir /etc/mysql
/etc/mysql/mysql.conf.d/mythtv.cnf:datadir = /srv/db
/etc/mysql/mysql.conf.d/mysqld.cnf:# datadir = /var/lib/mysql
That leaves the default untouched, because I don't want the MySQL/MariaDB package
manager's changes to change my selection. Note that I build from
source, so I don't have to worry about mythtv.cnf being overwritten
by any MythTV packages. Probably safer to use another .cnf name for
datadir.
Then I *copied* the entire MySQL DB, verified ALL directory and file
permissions and owner:group and restarted mysql. Probably with:
cd /var/lib/mysql
cp --preserve --recursive . /srv/db
Again, this was 9 years ago, test, test, test.
Restarted MySQL. Logged in to the DB just to be sure it was working.
Restarted the backend when it was.
--
Bill
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users http://wiki.mythtv.org/Mailing_List_etiquette MythTV Forums:
https://forum.mythtv.org