MySql/MariaDB cannot change default datadir on Debian 9.1 server
You must set ProtectHome=false in the systemd config file in order to move your datadir to the /home directory.

According to Debian policy rules, you should set this option value in a custom file like /etc/systemd/system/mariadb.service.d/YOUR_CUSTOM_FILE.conf containing:

[Service]

# Prevent accessing /home, /root and /run/user
ProtectHome=false


Then reload systemctl daemon:

systemctl daemon-reload

After that you should be able to change MariaDB datadir from /var/lib/mysql to /home/mysql.