How can i backup DB using COMMAND PROMPT on Windows server?

Discussion in 'MySQL' started by awaisuk, Mar 24, 2007.

  1. #1
    How can i backup DB using COMMAND PROMPT on Windows server?

    I use to do it perfectly when i was on linux using SSH, but now i dunno how to do it on Windows Server, I own the server so i have every right..

    Please help!
     
    awaisuk, Mar 24, 2007 IP
  2. tandac

    tandac Active Member

    Messages:
    337
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Depends on the database. :)

    mysqldump works pretty much the same on Windows or Linux.
    exp in Oracle
    pgdump in Postgre
    etc.

    If you're really stuck you can always take a cold backup:
    Shutdown database
    Copy/Zip/NtBackup all required data files
    Start database

    Cold backups have saved me a few times... :)
     
    tandac, Mar 25, 2007 IP
  3. awaisuk

    awaisuk Banned

    Messages:
    1,013
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Can you tell me in details how i perform the "cold backup" ? Also i am a newb at this so i need a little more explaination...

    Is there a command i can run in Command prompt to backup my db?

    I JUST WANT A BACKUP OF MY DATABASE, DOESNT MATTER IN WHAT WAY.
     
    awaisuk, Mar 25, 2007 IP
  4. tandac

    tandac Active Member

    Messages:
    337
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #4
    If I was scripting it...

    @echo off
    REM Assumes the database is installed in C:\MySQL
    REM Backups of the database are stored in C:\MySQL_Backup
    REM for later backup by a real backup program to proper media
    net stop mysql
    xcopy /s/e/c C:\MySQL C:\MySQL_Backup
    net start mysql

    ---
    or using mysqldump
    mysqldump -u root -p mydatabase > database.dmp
     
    tandac, Mar 25, 2007 IP
  5. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #5
    Performing this sort of operation doesn't seem to great to me, this would render any other services that rely on or use mysql pretty useless, I would just consult the mysql website on using the tools that come with mysql distribs and are available from thier website.
     
    krakjoe, Mar 25, 2007 IP