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.

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:
    1
    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:
    1
    Location:
    Coimbatore, India
    anyone ?
     
  3. roliboli

    roliboli Active Member

    Joined:
    Sep 3, 2003
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    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:
    6
    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
     
  5. d4rkl0rd

    d4rkl0rd Active Member

    Joined:
    Feb 23, 2004
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    India
    is the above command correct ?
     
  6. vavayi

    vavayi Member

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

    yes
    this is correct
     
Loading...

Share This Page