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!

mysql - restore / mysql dump

Discussion in 'General Discussion' started by pop, Jun 2, 2004.

  1. pop

    pop Member

    Joined:
    Oct 11, 2003
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    151
    hello,

    can anyone tell me

    1. how to restore a mysql database (from the server) ?
    2. how to mysql dump in the server ?

    I mean the commands to perform in the server and what is the exact difference bettween those two., what does that exactly do ? please let me know with an example.

    Thanks.
     
  2. JayPee

    JayPee Member

    Joined:
    Mar 2, 2004
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    151
    Location:
    Coimbatore, India
    anyone ?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. roliboli

    roliboli Active Member

    Joined:
    Sep 3, 2003
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    Switzerland
    Dump a database:
    mysqldump -c -a -v --add-drop-table -u dbuser -p database > backup_filename.sql

    Restore this database with the backup_filename.sql:
    mysql -u dbuser -p database < backup_filename.sql

    Or through the phpMyAdmin
     
  4. d4rkl0rd

    d4rkl0rd Active Member

    Joined:
    Feb 23, 2004
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    India
    Roliboli,

    Thanks for ur help. Is this correct and can I run this command from anywhere ??

    dump:
    mysqldump db_name > /home/username/public_html/backup_filename.sql

    restore :
    mysql -u root -p rootpassword db_name < backup_filename.sql
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. d4rkl0rd

    d4rkl0rd Active Member

    Joined:
    Feb 23, 2004
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    India
    is the above command correct ?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. vavayi

    vavayi Member

    Joined:
    Aug 4, 2008
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    51
    cool

    yes
    this is correct
     
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