LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Mysql dumps via Cron job. (https://www.linuxquestions.org/questions/linux-software-2/mysql-dumps-via-cron-job-210627/)

Thrifty 07-28-2004 10:21 AM

Mysql dumps via Cron job.
 
Hi.

I'm trying to figure out how to do daily dumps of a MySql database via Cron job. Doing the dump is easy enough, BUT it requires a password. Cron can't enter passwords. Is there any way to do this? Either pass along the password in the command line (so that Cron CAN enter the password) or set it so that you don't need a password to do the dump?

hw-tph 07-28-2004 02:03 PM

You can pass a password on the command line:
Code:

mysqldump -u User -pPassword database > filename
Note the lack of space between -p and the actual password.

Håkan

Thrifty 07-28-2004 02:13 PM

Quote:

Originally posted by hw-tph
You can pass a password on the command line:
Code:

mysqldump -u User -pPassword database > filename
Note the lack of space between -p and the actual password.

Håkan

A space! That's the culprit. I got it now. Thanks.


All times are GMT -5. The time now is 04:21 AM.