SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2001
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would like to know, lets say I have a few tables with username\password info in it and I would like to carry that info around with me in a form of .sql, can it be done?

    How?

  2. #2
    SitePoint Addict
    Join Date
    Nov 2000
    Location
    London, UK
    Posts
    223
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sure ..
    PHPMyAdmin has a dump table function you can use. It'll even send it as a download (which is probably the best). Or you can just have it dump the whole database.
    Otherwise, you can write a simple PHP script that'll output everything in a comma delimited format or something like that .. email/post for an example

    ... what's the world coming to?

  3. #3
    SitePoint Zealot Overgrow's Avatar
    Join Date
    Jan 2001
    Location
    Your basement
    Posts
    192
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    man mysqldump

    mysqldump -p databasename optionaltablenames > file.sql

    Lots of options on the dump command.. OPT is usually a good idea, also lock the tables, and a few other things. to read it back in:

    mysql -p < file.sql
    Overgrow the Government: The Edge Forums
    presented by Overgrow Marijuana Magazine

    *warning: adult content

  4. #4
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    .sql is not a specific extension in this case if the file only contains SQL query
    I can name it: "backup.sql", "backup.txt" or just "backup"
    All contains the same thing: TEXT

    However, if there is .sql which aren't contain SQL query or it's a binary file then that's a different story.
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  5. #5
    SitePoint Evangelist lirux's Avatar
    Join Date
    Jan 2001
    Location
    Lisboa : Portugal
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm also really interested in this one. I have a db called liruxdb; After reading this post, I supose all I'd need to do is:

    1: Login using telnet

    3: type :
    mysqldump -p liruxdb > file.sql
    Type no table names becouse I want them all backed up

    4: be prompted for my password ant type it in

    6: close telnet

    7: Login to FTP and download my file

    is this right? Don't I need to start mysql (mysql -u username -p)?

    Thanks 4 Ur help ppl!
    Duarte Carrilho da Graša
    RailsHelp.com: Searchable Rails reference
    CACA: Committee for the Annihilation of Complicated Acronyms

  6. #6
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need your user name and to obtain the fastest dump, use --opt

    mysqldump --opt -u usr -p DBNAME > file.sql
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  7. #7
    SitePoint Evangelist lirux's Avatar
    Join Date
    Jan 2001
    Location
    Lisboa : Portugal
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks son
    Duarte Carrilho da Graša
    RailsHelp.com: Searchable Rails reference
    CACA: Committee for the Annihilation of Complicated Acronyms


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •