Converting excel into MSQL

Discussion in 'MySQL' started by icare, Apr 2, 2006.

  1. #1
    Hello friends,

    ilts a newbie question..

    Is it possible to convert database on spread sheet into msql?
    If yes how hard is it?
    Can a newbie do it?

    ANy help will be highly appreciated
     
    icare, Apr 2, 2006 IP
  2. sacx13

    sacx13 Active Member

    Messages:
    438
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #2
    I think you cannot find a script to export directly to mysql syntax... but you can export in text file and after that to import directly in mysql.

    To export in text File use http://bioinformatics.uams.edu/micr...ols/Excel2text/

    If you want to import a csv to mysql try to use :
    http://www.stadtaus.com/php_scripts...ysql_script.php

    Also is very easy to import a csv in mysql diretcly from mysql command line or froma a query shell:
    LOAD DATA LOCAL INFILE '/tmp/csv.file' INTO TABLE `table` FIELDS TERMINATED BY ',' ESCAPED BY '\\' LINES TERMINATED BY '\r\n'

    For that csv.file need to be on server.

    Regards
     
    sacx13, Apr 2, 2006 IP
  3. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It's really pretty easy.


    1. Open your excel file
    2. Save as .csv
    3. Open up you PhpMyAdmin
    4. Go to the table you want to import into
    5. Click the "Insert data from a textfile into table" link at the bottom
     
    exam, Apr 4, 2006 IP
  4. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0