creating a .sql text file from a database

Discussion in 'Site & Server Administration' started by saich, Oct 11, 2007.

  1. #1
    How can i export a website database to an .sql file from the command prompt....pliz help me with the scripts i'm really stuck
     
    saich, Oct 11, 2007 IP
  2. cyanide

    cyanide Peon

    Messages:
    483
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try this:

    mysqldump -u username -ppassword database > /database.sql
     
    cyanide, Oct 11, 2007 IP
  3. ThreeGuineaWatch

    ThreeGuineaWatch Well-Known Member

    Messages:
    1,489
    Likes Received:
    69
    Best Answers:
    0
    Trophy Points:
    140
    #3
    You might want to make the target:

    ~/database.sql

    Create it in your $HOME instead of on the root file system. Otherwise, if it is a large DB you can fill the root filesystem quickly which is not recommended. ;)

    You might like to look at the -h switch to specify a mysql host if the DB is not local.
     
    ThreeGuineaWatch, Oct 13, 2007 IP