How to take backup of Mysql database?

Discussion in 'MySQL' started by computerzworld, Jun 6, 2007.

  1. #1
    Hi. I want to take the backup of mysql database. How can I take it using query or command? Please tell me. I tried with this one but it didn't worked. so what should be the problem with this? Please tell me.

    mysqldump -u root -p databasename > backup.sql


    Thanks in advance.
     
    computerzworld, Jun 6, 2007 IP
  2. turiel

    turiel Peon

    Messages:
    148
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Why did that command not work? What error did you get?

    You have the login for root, right?
     
    turiel, Jun 7, 2007 IP
  3. jakomo

    jakomo Well-Known Member

    Messages:
    4,262
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    138
    #3
    Hello

    Look around devarticles.com/c/a/MySQL/Backing-Up-Your-MySQL-Databases-With-MySQLDump/2/

    Best regards!
    Jakomo
     
    jakomo, Jun 7, 2007 IP
  4. jamix

    jamix Peon

    Messages:
    30
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Try it like this:

    mysqldump -uroot -p databasename > backup.sql

    (No space between '-u' and 'root'). Hope that helps.
     
    jamix, Jun 13, 2007 IP
  5. lkj

    lkj Peon

    Messages:
    729
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #5
    what error did you get?

    maybe you need to specify full path to mysqldump utility if it's not in your path.

    also, maybe you need root permissions to run mysqldump binary utility
     
    lkj, Jun 15, 2007 IP