SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast raynebair's Avatar
    Join Date
    Dec 2000
    Location
    Alabama
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I keep getting errors when trying to load textfiles into mySQL. I'm using the PHPmySQL Administrator tool that is on my web host.

    If I use the feature they have I get an error that a /tmp/jflsj [garbage file name] is not in the database directory or must be readable by all.

    If I type the code into the query box and try to do it that way I keep getting syntax errors. I even got my DBA at work to help me with it and he said it may be the parser on the database that is parsing the code wrong.

    I have a lot of data that I need to import into my database and I have yet to figure out how without having to enter it all in again.

    Can anyone help?

  2. #2
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    MySQL insists that any text files that you want to load infile must
    a) reside in the same directory as the database - which your host will not let you do,
    or b) be read/writable by all ie CHMOD 0777, this is to prevent people from loading /etc/password/ etc into their DB so basically you need to copy the file to your server via copy() and CHMOD to 0777 , again via script. Then your data should load just fine, assuming you have no illegal charaters etc.

  3. #3
    SitePoint Enthusiast raynebair's Avatar
    Join Date
    Dec 2000
    Location
    Alabama
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, I tried that and I keep getting an error saying it can't get the status of the file.

    Why is that? I have the files CHMOD 777 in the same directory as the script.

    Can you give me the syntax to load the file so I can check it to mine and see if I am doing it wrong.

    Thanks.


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
  •