Issue While backup site

App server is on one server and DB server is on another server.
While taking the backup getting issue: Backup failed for Site erp.demo.com Database or site_config.json may be corrupted.
while running on App server : config set as

bench set-mariadb-host [IP ADDRESS FOR DATABASE HOST]
bench new-site erp.demo.com --mariadb-root-password [YOUR PASSWORD OF CHOICE]

And in DB server installed mariadb Permissions like :

GRANT ALL PRIVILEGES ON *.* TO 'root'@'[IP ADDRESS FOR ERPNext HOST]' IDENTIFIED BY 'YOUR PASSWORD OF CHOICE' WITH GRANT OPTION;
FLUSH PRIVILEGES;

EXIT;

Restart MySQL server to effect all the made changes.

sudo service mysql restart