Web Analytics Made Easy -
StatCounter HELP importing excel into PHPmyAdmin (already searched) - CodingForum

Announcement

Collapse
No announcement yet.

HELP importing excel into PHPmyAdmin (already searched)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • HELP importing excel into PHPmyAdmin (already searched)

    Hi guys,

    First off, I will say that I already searched for over an hour on this subject and tried EVERYTHING I could think of to get this working, no luck.

    I have several excel files that I need to import into a table. I use PHPMyAdmin.

    I know the whole insert data from textfile deal and I know you must convert to a CSV but something is not working, no matter what I seem to do, I get the following error <b>"File could not be read /tmp/phpN2DCgh
    "</b>

    I thought maybe it was my file that wasn't working but then I inserted a record in the table and exported into CSV and still no luck, same error.

    I think the problem has to do with the settings I am choosing under the insert data from text file thing.

    Here is the test record I am trying to insert for reference: "3434","dfdf","45454","dffd","dfdf","dfdfdf","2005-01-12","dfdf","343434","34343434","3.33","2000-11-11","sdsdsd","sadsadsad","23334343434","0000-00-00","22","kalamazoo","notes","33"

    And the field names I have are: address city zip twp mortgagor mortgagee date_recorded assignee price SEV rate redempt_date legal contact number newspaper_date issue county notes parcID

    The settings I am choosing are:

    Fields terminated by: ,
    Fields enclosed by: "
    Fields escaped by: \
    Lines terminated by: \r\n
    Column names: address city zip twp mortgagor mortgagee date_recorded assignee price SEV rate redempt_date legal contact number newspaper_date issue county notes parcID
    LOAD method: ...DATA


    Does anyone who has imported a CSV before know what I am doing wrong?

    Thanks!

  • #2
    wat i am doing is 3 steps:
    1. go to mySQL4.1 > Command Line Client > enter the following command
    mysql> USE db1;
    mysql> LOAD DATA INFILE 'data.cvs' INTO TABLE my_table FIELDS TERMINATED BY ',';

    2. Use mySQL Administrator to backup the particular table(my_table) to xxx.sql.

    3. go to phpmyadmin > select the database & table > choose the "SQL" tab > Location of the textfile : select the xxx.sql file u saved.
    Thanks.
    =====================================================
    From NinjaTurtle
    ++http://ohmygoh.blogspot.com|http://technology.ohmygoh.com++

    Comment


    • #3
      LOL, I didn't know mysql could do that. That's awesome. Now I don't have to use that freaky easypopulate for osCommerce.

      By the way be sure to use "," instead of ','

      Where do you put the csv file? Can you use an absolute path, say /home/mrruben5/data.csv?
      CATdude about IE6: "All your box-model are belong to us"

      Comment


      • #4
        Actually i am using ',' but not ","... may be it works for both...

        i tried 'c:/..../xxx/xxx/data.cvs' but it is not working, so it is working only put the cvs file into the particular datbase name folder.

        example: i want to insert a list of data into "Customer" table which under database called "Shop"... so it will have a "Shop" folder under "C:\Program Files\mySQL\data\". so just copy the csv file into this folder. and its works.

        But i will try to test again...
        brb....
        Thanks.
        =====================================================
        From NinjaTurtle
        ++http://ohmygoh.blogspot.com|http://technology.ohmygoh.com++

        Comment

        Working...
        X