Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

How to back up mysql database using cron jobs?

Discussion in 'Database Discussion' started by guymelef, Dec 15, 2006.

  1. guymelef

    guymelef Member

    Joined:
    Nov 30, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    151
    Hi,

    I want to back up my mysql database once a week

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

    mitul Well-Known Member

    Joined:
    Feb 8, 2003
    Messages:
    291
    Likes Received:
    0
    Trophy Points:
    166
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. instinctsamsung

    instinctsamsung Registered

    Joined:
    Apr 21, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    51
    where does it save the SQL file?
     
  4. WebScHoLaR

    WebScHoLaR Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    511
    Likes Received:
    3
    Trophy Points:
    168
    Location:
    Planet Earth
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. vladbbk

    vladbbk Registered

    Joined:
    Feb 19, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    51
    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
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice