I am not very experienced with databases so I hope my question makes sense.
I am setting up a MySQL/MariaDB instance for Nextcloud on my Ubuntu server and the data will be stored on a ZFS pool.
Several guides/blogs mentions that its best practice to separate data and log files to separate datasets with different properties. So in I add the following to my my.cnf
configuration file so that logs and data are stored in different directories and not directly under /var/lib/mysql
which is the default.
[mysqld]
datadir = /var/lib/mysql/data
innodb_log_group_home_dir = /var/lib/mysql/log
innodb_data_home_dir = /var/lib/mysql/data
slow_query_log_file = /var/lib/mysql/log/slow.log
log_error = /var/lib/mysql/log/error.log
aria-log-dir-path = /var/lib/mysql/log
In the /var/lib/mysql
directory I see that the data/
and and log/
directory has been created and contains some files.
drwxr-xr-x 7 mysql mysql 9 Apr 18 08:03 ./
drwxr-xr-x 8 root root 8 Apr 6 00:10 ../
drwxr-xr-x 2 mysql mysql 5 Apr 18 08:03 data/
drwxr-xr-x 2 mysql mysql 6 Apr 18 08:03 log/
-rw-rw---- 1 mysql mysql 0 Apr 18 08:03 multi-master.info
drwx------ 2 mysql mysql 90 Apr 18 08:03 mysql/
-rw-r--r-- 1 mysql mysql 15 Apr 18 08:03 mysql_upgrade_info
drwx------ 2 mysql mysql 3 Apr 18 08:03 nextcloud/
drwx------ 2 mysql mysql 3 Apr 18 08:03 performance_schema/
However, there are still some additional files and folders (I guess one for each database, they only contain a db.opt
file) in the /var/lib/mysql
directory.
Are these files/folders not considered neither data nor logs and and if I were to backup/recreate the dababase(s) on a different system would I need to copy anything other than the data/
directory?