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!

Database dump syntax ?

Discussion in 'Database Discussion' started by oldlock, Aug 6, 2013.

  1. oldlock

    oldlock Well-Known Member

    Joined:
    Sep 19, 2008
    Messages:
    76
    Likes Received:
    0
    Trophy Points:
    56
    Can anyone please advise the correct syntax to :

    Backup an existing database by SSH and write the resulting file to the server where it can then be retrieved via FTP ?

    TIA
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,385
    Likes Received:
    1,857
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello :)

    You can use the mysqldump utility. EX:

    Code:
    mysqldump database_name > /path/to/database.sql
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. oldlock

    oldlock Well-Known Member

    Joined:
    Sep 19, 2008
    Messages:
    76
    Likes Received:
    0
    Trophy Points:
    56
    That threw back an error - should there be a password in that string ??
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,309
    Likes Received:
    393
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Try this:
    Code:
    mysqldump --opt -Q -u dbUsername_dbUsername -p dbUsername_dbName > /path/to/save/bu/to/backupname.sql
    Type in password when asked.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. oldlock

    oldlock Well-Known Member

    Joined:
    Sep 19, 2008
    Messages:
    76
    Likes Received:
    0
    Trophy Points:
    56
    That worked perfectly. Very quick too. Thanks.
     
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