Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Nov 2006
    Posts
    22

    Question How to back up mysql database using cron jobs?

    Hi,

    I want to back up my mysql database once a week

    How would I be able to do it using cron jons?

  2. #2
    Member
    Join Date
    Feb 2003
    Posts
    291

    Default

    Mysql backup can be schedule using mysqldump through cron.

    Below is the example.

    * * * * * mysqldump -u USERNAME -pPASSWORD database > database_backup.sql

    Set the days as per your requirements.
    Mitul

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    1

    Default

    where does it save the SQL file?

  4. #4
    Member WebScHoLaR's Avatar
    Join Date
    Dec 2005
    Location
    Planet Earth
    Posts
    506

    Default

    You can specify any location and the SQL file will be saved there.


    mysqldump -u USERNAME -pPASSWORD database > /path/to/sql/file/database_backup.sql

    Regards,
    WebScHoLaR

    WebHosting Blog: http://WebScHoLaR.net

  5. #5
    Registered User
    Join Date
    Feb 2010
    Posts
    4

    Default

    mysqldump -u USERNAME -pPASSWORD database > /path/to/sql/file/database_backup.sql

    Enter password: mysqldump: Got error: 1045: Access denied for user 'vlad_u'@'localhost' (using password: NO) when trying to connect


    Please hellp me

Similar Threads & Tags
Similar threads

  1. How to back up MySQL database?
    By calvinphanctt in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 03-18-2011, 06:08 AM
  2. Cron Job to back up MySQL database
    By BMR777 in forum New User Questions
    Replies: 1
    Last Post: 01-30-2010, 06:24 PM
  3. How to Backup PostgreSQL database in Cron Jobs??
    By beegeok in forum Database Discussions
    Replies: 0
    Last Post: 09-14-2005, 04:39 AM
  4. How to Back up database and/or files by setting up a cron?
    By Binesh in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 11-11-2004, 02:14 PM
  5. Cron Jobs [Back Up]?
    By Justin182004 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-28-2004, 03:21 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube