Take backup of MySQL Database with help of PDO PHP and email it with PHPMailer to your email address.
USAGE
Add your config settings into the backup.config file (example settings in backup.config.example)
execute as
$ php -f pdo-db-backup.php
Edit and add Required parameters with your values.
Done...
You can Run this pdo-db-backup.php script in your browser or via cron job.
Base code taken with a big thank you from https://write.corbpie.com/php-pdo-mysql-backup-script-with-compression-option/