looking for a way to allow users to backup the plugin db data(save as)

WP has Filesystem API to write files.

However it can be relatively convoluted to implement (since it handles fallback for many cases and environments and workflow for requesting FTP crednetials from users) so often simply PHP functions are used to write file. Works reliably when constrained to uploads folder, otherwise need to be sure about environment or use Filesystem API.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)