By mnaslund
I got below: mysqldump -u doadmin -p -h mysql-test-do-user-4915853-0.db.ondigitalocean.com -P 25060 --single-transaction --set-gtid-purged=OFF your_database_name \
/path/to/database_file.sql
Trying to use this in a cronjob without success (adding password to above). Is it not doable to mnysqldump a digitalocean managed database through cronjob?
I noticed “The application prompts you for your MySQL doadmin user password.” from above URL. Does that mean you cant authenticate through cron command?
Thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
What I could suggest is following the steps from this tutorial here on how to how to create an export script to backup your database:
https://devdojo.com/bobbyiliev/how-to-exportbackup-a-mysqlmariadb-database-with-mysqldump
It suggests the following:
In order to do that you need to make sure that you have the following content in your .my.cnf file. The file should be stored at:
/home/your_user/.my.cnf
You should make sure that it has secure permissions:
chmod 600 /home/your_user/.my.cnf
And you should add the following content:
[client]
user=your_mysql_user
password=your_mysql_password
Once you have your .my.cnf file configured, you set up a cronjob to trigger the mysqldump export of your database.
Let me know how it goes!
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.