#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2010
    Posts
    17
    Rep Power
    0

    Attaching a database


    I'm a beginner at MySQL and need to attach a database that was emailed to me as an email attachment. It has a .sql extension.

    How do you do this?
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,118
    Rep Power
    4274
    open it up in a text editor, and see if it contains CREATE and INSERT sql statements

    if so, you don't attach it, you run it into mysql as a file, so that the sql statements can be executed
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2010
    Posts
    17
    Rep Power
    0
    In Notepad, it has nothing I can read in it. Most of the characters are not regular letters or digits. There are no inserts or creates in it.
    How do you turn this into mysql data?
  6. #4
  7. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,118
    Rep Power
    4274
    any chance it's compressed?

    an sql file from mysql can also be a csv or delimited text or xml file

    see http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo