Answer the question
In order to leave comments, you need to log in
Ubuntu, should I specify the root password in the script?
Hello again everyone. This time the question is about the database dump script.
On the Internet, I found a simple script
DIR=`date +%F_%H-%M`;
mkdir /home/backup/$DIR;
mysqldump -uroot -p12345 my_girl_db > /home/admin/backup/my_girl_db.sql
zip -r -0 /home/www/you_site.ru/ /home/admin/backup/$DIR/
Answer the question
In order to leave comments, you need to log in
make a separate read-only user and dump to your heart's content. Limit it to only localhost yet (since you're doing it on the same server)
Debian (and clones) has a special MySQL user (debian-sys-maint). There is a special configuration file for this user (/etc/mysql/debian.cnf). Dumps can be made using this file with the option --defaults-file
mysqldump --defaults-file=/etc/mysql/debian.cnf ...... The
downside of this solution is that you can only run this command as a system root.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question