Setup database backup cron job on godaddy hosting account
Many time you need to setup Cron Job to schedule specific task at regular interval. This article covering cron job setup on godaddy account. Godaddy account has different interface then traditional cpanel. These instructions apply to WordPress.com server installations. Here are the steps to take daily backup of DBS.
Here are the steps to setup cron job for daily backup of database.
- Log Into your GoDaddy.com account.
- Choose “My Hosting Account” from the “Hosting & Servers” menu on the top navigation bar.

- In the Hosting Account list, click the Open link beside the account you want to use for your website.

- In the Hosting Manager window, click the Cron Manager icon or “Cron Manager” menu item under content menu. Please refer snapshot below.

- Now you are on the page where you need to setup cron job. Before this, you need to collect following information with the database..Host Name: (Usually localhost but in case of godaddy account it will be look like mysql139.secureserver.net) Database Name: Name of the backup database.
User Name: User name of associative database. In case of godaddy account it will be same as db name.
DB Password: Database user password for authentication. - Please use following mysqldump command to get backup of desired database. Please change required parameter with your own.Syntax:
mysqldump –opt -Q -h (hostname) -u (user-name) –password=(password) (database-name) > (full path of backup file)Example:
mysqldump –opt -Q -h p3smysql5.secureserver.net -u mywebdb –password=password mywebdb > /home/content/b/a/b/babychep/html/backups/daily.sqlPlease replace variable with new one and put entire command in command text box. No need to use browse button here. Select how you want to run these command hourly,daily,weekly and click on save button to save cron job.
Read Related Posts
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.



January 20th, 2009 at 9:26 am
[...] an article over here that shows you how to backup your GoDaddy MySQL databases using a cron job so if you’re [...]
March 10th, 2009 at 7:38 am
Of course, what a great site and informative resources, I will add backlink.
March 13th, 2009 at 2:19 pm
Hi– I tried your cron recommendation, but I haven’t been successful. Here’s the error I get via email:
———
Got error: 1045: Access denied for user ‘[username removed]‘@’[IP address removed]‘ (using password: NO) when trying to connect
———
I do have the password there in the actual script … why does it not recognize it?
March 26th, 2009 at 3:15 pm
Godaddy Requires that you have SSH enabled in order to run Cron Jobs from the Cron Manager tab now. This will allow you access to the database through Cron.
April 3rd, 2009 at 5:26 am
Nice site! Thanks for the great post. People should read this.
April 11th, 2009 at 12:28 pm
Thanks for the great tip. I am experiencing the same issue as previous poster Matt and I have SSH enabled for my site. I also have a cron job that backups up web application on my site via a script actually on my web server that works without issue. Any help would be appreciated.
June 11th, 2009 at 1:54 pm
I get the following error and like other post I am using a password
mysqldump: File ‘/usr/share/mysql/charsets/?.conf’ not found (Errcode: 2)
mysqldump: Character set ‘#33′ is not a compiled character set and is not specified in the ‘/usr/share/mysql/charsets/Index’ file
mysqldump: Got error: 1045: Access denied for user ‘removed’@’208.109.181.75′ (using password: NO) when trying to connect
July 3rd, 2009 at 7:40 am
Greetings that really is insightful, great effort for this work you’ve done. Could I replicate this post on my site?
July 8th, 2009 at 2:59 pm
Hey ive seen a lot of people having errors such as
mysqldump: Got error: 1045: Access denied for user ‘removed’@’ip′ (using password: NO)
i BELEIVE (at least i worked for me) that the error is in the article
make sure you remove the -password=YourPassword
it should be -pYourPassword… for example:
(only a -p followed bu your password WITHOUT SPACE!)
so the article SHOULD say something like this….
Please use following mysqldump command to get backup of desired database. Please change required parameter with your own.Syntax:
mysqldump –opt -Q -h (hostname) -u (user-name) –password=(password) (database-name) > (full path of backup file)
Example:
mysqldump –opt -Q -h p3smysql5.secureserver.net -u yourusername –pYoUrPaAsWorD yourdbname > /home/rourabsolutepath/html/backups/daily.sql
hope you fix the error and good luck!
July 8th, 2009 at 3:42 pm
hey everyone, here is another solution, that worked for me as well, in case you dont get the other one running… just follow all the steps listed in this article and in the cronjob field write
mysqldump -h p3smysql5.secureserver.net -uUsErNaMe -pPaSsWoRd yOuRdBnAmE > /home/absolutepath/dump.txt
where you need to update where it says ‘p3smysql5.secureserver.net’ for your own server address,
‘UsErNaMe’ with your username,
‘PaSsWoRd’ for your own password,
‘yOuRdBnAmE’ for your database name, and
‘/home/absolutepath/’ for your absolute path
cheers….
July 8th, 2009 at 4:16 pm
well, this is my third post today, but i hope it helps
its one last small addition to my last solution
you might also wanna add the date to the file name of the backup, just in case you dont want the file to be overidden everytime it backs itself up, you can have a copy of everyday backup….
just ass this to the file name: dump_$(date +” “\%d\%m\%Y).txt
so it would look like this:
mysqldump -h p3smysql5.secureserver.net -uUsErNaMe -pPaSsWoRd yOuRdBnAmE > /home/absolutepath/dump_$(date +” “\%d\%m\%Y).txt
where you need to update where it says ‘p3smysql5.secureserver.net’ for your own server address,
‘UsErNaMe’ with your username,
‘PaSsWoRd’ for your own password,
‘yOuRdBnAmE’ for your database name, and
‘/home/absolutepath/’ for your absolute path
have a great day!
August 21st, 2009 at 1:39 pm
One minor point. I am not sure if it is my browser, or something with your editor, but the commands should be:
–opt and
–password
ie minus minus
not a long dash. I think that this is what is causing some of the problems.
Thanks though, once I figured this, it solved my issue.
August 21st, 2009 at 8:34 pm
yes right, editor automatically change two continuous dash to one long dash. Thanks your tips.. I will check and fix issue asap..
August 24th, 2009 at 5:54 am
not working
February 7th, 2010 at 9:03 am
Very usefull blog
February 7th, 2010 at 9:16 am
good stuff here
March 15th, 2010 at 6:01 am
Thanks for the tips. I tried to use all the notes here to get it to work and FINALLY did with some tweaking.
First off: with Godaddy you need to be using SSH! Make that switch first, this will take a couple of days.
2nd my cron job is as follows:
mysqldump –opt -Q -h yourdomainname.com -uusername -pPassword databasenamesameasusernameusually | gzip > /home/content/a/b/c/abc/html/backups/databasebackup_`date +\%Y\%m\%d\%H\%M\%S`.sql.gz
Keep in mind: no space between the -u and username. no space between the -p and password. Also for the date code, backword slashes (\) before the % signs. Hope this helps others.
March 27th, 2010 at 6:59 am
How do I find my “absolute path?” I don’t see it listed in the control panel and don’t know its exact sequence. I’m assuming I can’t just use a http:// etc…?
March 27th, 2010 at 7:11 am
Are you looking absolute path of your php file? If yes, use phpinfo to get exact path.
May 26th, 2010 at 12:42 pm
Looks like Im going to have to do some more research, but this is a really good strting point.
August 15th, 2010 at 1:58 am
How can i setup multiple databases (15-25) backup in one cron job?
November 11th, 2010 at 1:48 am
I kept having issues with the syntax. Not sure if they use different version of whatever software. What did work was:
echo “Backing up WordPress database”
mysqldump -h YOUR.DBSERVER.COM -uUSERNAME -pPASSWORD DATABASENAME > $HOME/html/backups/database/$NOWDATE.sql
gzip -9 $HOME/html/backups/database/$NOWDATE.sql
echo
echo “Job finished!”
I found this on a site whilst looking at yours (http://www.fortasse.com/2010/01/tutorials/tutorial-automatic-backup-script/). I used a combo of yours and his.
Also,
if you are using Windows PLEASE make sure to use a GOOD text editor such as EditPad Lite or maybe just use dos2unix or unix2dos. Both can be found in most distros and you can also use online versions
Cheers,
JB
December 2nd, 2010 at 9:22 pm
Thanks to this post I was able to get mine working! To return the favor, here’s some help:
ANSWERS TO QUESTIONS
——————–
If you’re getting the “Access Denied” message, try removing the “-opt -Q” part of the query. That worked for me!
To get the full path, you can SSH into your server (as other people have said, you need SSH for this to work) and from the directory you want the path of, type “pwd” and hit enter: it will echo it back to you.
December 30th, 2010 at 5:48 am
Great post. I just setup my backend so I could backup using php (just click a single link and wham..).. But, cron will do the remembering for you. So, when godaddy tells you it will be 3 to 9 days before they can get your website backup, you can make other arrangments.
April 20th, 2011 at 8:38 pm
I am not an experienced person when it comse this. I was given a cron job script to run within Godaddy and am trying to use it…
mysqldump –opt -Q -h (database login) -u (loginname) –password=(yourpassword) (nameofdatabase) > (absolutepath/DBNAME_`date ‘+%m-%d-%Y_%H-%M’`.sql)
I do not know how to determine absoulte path here. Path to where? Is this to store a copy of database on the database server or what? please help.
October 7th, 2011 at 2:04 am
i have afull backup of my site and can not restore in my godaddy webhosting plaze anyone can help what can i do?
December 2nd, 2011 at 3:51 pm
Austin online marketing…
[...]Setup database backup cron job on godaddy hosting account | Bala-Krishna[...]…