cron:: automatic database restore

Status
Not open for further replies.

MultiMediaMadness

New Member
Messages
30
Reaction score
0
Points
0
Why doesn't this work

0 0 * * * mysql -D mmm_Demo -u <database username> -p <password> < /home/mmm/localhost.sql

I receive this error by mail:
Enter password: ERROR 1045 (28000): Access denied for user 'database username'@'localhost' (using password: YES)
 

Micro

Retired staff <i> (11-12-2008)</I>
Messages
1,301
Reaction score
0
Points
36
are you remembering your cpanel username in front of the sql username? e.g.

sql username mojo would become mmm_mojo (if mmm is your cpanel name).
 

jaygreentree

Member
Messages
148
Reaction score
1
Points
16
MultiMediaMadness said:
Why doesn't this work

0 0 * * * mysql -D mmm_Demo -u <database username> -p <password> < /home/mmm/localhost.sql

I receive this error by mail:
Enter password: ERROR 1045 (28000): Access denied for user 'database username'@'localhost' (using password: YES)

Thats not a valid cron request. what you are trying to do requires SSH not cron and I would think that SSH is disbaled for security.
 

Micro

Retired staff <i> (11-12-2008)</I>
Messages
1,301
Reaction score
0
Points
36
Get a php script to backup your tables / dbs that you want, then call it using php -f /home/usenrame/dbbcakup.php (You can put it outside your directory root, its best if you do then people cant exec it from your website).
 
Status
Not open for further replies.
Top