After you change the data directory path in MariaDB, you may see the following error, when you try to restart the DB service.
Error 1067: The process terminated unexpectedly
This is because MariaDB runs as Network Service who does not have read-write access to every directory. To fix the problem, you should either make the directory writable for Network Service or change the user to one that has read-write access to the directory.