The package MariaDB-server installs the file /usr/lib/tmpfiles.d/tmpfiles.conf with the following content:
The man page of systemd-tmpfiles.d says the following:
systemd-tmpfiles uses the configuration files from the above directories to describe the creation, cleaning and removal of volatile and temporary files and directories which usually reside in directories such as /run or /tmp.
/var/lib/mysql is not a temporary nor volatile directory. It should not be created using systemd-tmpfiles.d. It's also a problem if a different datadir is being used (/var/lib/mysql is created at system startup without content).