OSMC 2018.04-1 ---17.6 crashes everyday

You don’t say what the NAS is. To install a MySQL server (now MariaDB on Debian stretch), the following instructions should be a reasonable template for most *nix systems.

The client configuration is detailed at the top of the thread.