http://kodi.wiki/view/Syncing_and_sharing
Use the MySQL option.
You may also want to consider using fstab mounts instead of smb://