The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Database dump syntax ?

Discussion in 'Database Discussions' 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:
    37,064
    Likes Received:
    1,288
    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.
     
  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:
    15,618
    Likes Received:
    296
    Trophy Points:
    433
    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.
     
  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