Variable 1: magento_user (name of the Magento database user)
Variable 2: magento_database (name of your Magento database)
Variable 3: backup_filename.sql (filename to save as)
Example
mysqldump -u bob -p magento_main > magento_20200615.sql
Then you’ll be prompted for your magento_user password. The screen will “freeze” for a few minutes whilst it’s working and then prompt you to say it’s complete. It’ll save in whatever directory you run the command from. Doesn’t matter if you’re a superuser or not.