LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-28-2004, 10:21 AM   #1
Thrifty
Member
 
Registered: Jan 2004
Location: Durham, North Carolina
Distribution: SuSe
Posts: 36

Rep: Reputation: 15
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?
 
Old 07-28-2004, 02:03 PM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
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
 
Old 07-28-2004, 02:13 PM   #3
Thrifty
Member
 
Registered: Jan 2004
Location: Durham, North Carolina
Distribution: SuSe
Posts: 36

Original Poster
Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Optimize MySQL Database Cron Job Help br00tal Linux - General 3 10-03-2005 04:45 PM
Cron job rajasekarvr Linux - General 4 05-03-2004 05:35 PM
cron job ? johnyy Linux - Software 3 12-10-2003 06:00 PM
Cron Job to Repair MySQL tables? Shinjuku Linux - Software 0 07-13-2003 08:34 AM
cron job? luap Linux - Software 2 03-16-2003 08:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration