SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jul 2002
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mySQL - loading txt file to populate the table

    Hello,
    How do I load .txt file to populate the table. The manual said use this command: mysql> LOAD DATA LOCAL INFILE "filename.txt" INTO TABLE TableName;

    Where do i keep my filename.txt; does it find the file automatically?

    Thanks in advance for your help.

    Daeung

  2. #2
    SitePoint Zealot
    Join Date
    Jun 2002
    Location
    Newcastle, UK
    Posts
    128
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    haven't done it that way, but if you have the text file, why not convert it into a php script and run it on the server?

  3. #3
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anywhere, just specify the path to it:

    Code:
    LOAD DATA LOCAL INFILE "/path/to/filename.txt" INTO TABLE TableName;
    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature


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
  •