SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: phpMyAdmin

Hybrid View

  1. #1
    Bah, I'll just hack it DoobyWho's Avatar
    Join Date
    Jul 2002
    Posts
    476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    phpMyAdmin

    Whenever I try to import a .txt file into my database I keep getting this..

    " ErrorSQL-query : LOAD DATA LOCAL INFILE '/tmp/phpVUa0Ya' INTO TABLE `Wine` FIELDS TERMINATED BY ';' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\r\n' (`sku`, `vintage`, `category`, `country`, `color`, `appellation`, `name`, `price`)
    MySQL said:
    File '/tmp/phpVUa0Ya' not found (Errcode: 0)"

  2. #2
    Bah, I'll just hack it DoobyWho's Avatar
    Join Date
    Jul 2002
    Posts
    476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone?

  3. #3
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks like bad formatting within your file you want to import ?

    Don't use this part of phpMyAdmin although the use of LOAD DATA is well documented within the mySQL manual and I would recommend that you read this;

    Will proberly point you in the right direction. Look at Chapter 7.19:

    For security reasons, when reading text files located on the server, the files must either reside in the database directory or be readable by all. Also, to use LOAD DATA INFILE on server files, you must have the file privilege on the server host. See section 6.7 Privileges provided by MySQL.
    If you specify the keyword LOW_PRIORITY, execution of the LOAD DATA statement is delayed until no other clients are reading from the table.
    Using LOCAL will be a bit slower than letting the server access the files directly, because the contents of the file must travel from the client host to the server host. On the other hand, you do not need the file privilege to load local files.
    You can also load data files by using the mysqlimport utility; it operates by sending a LOAD DATA INFILE command to the server. The --local option causes mysqlimport to read data files from the client host.
    Good Luck

  4. #4
    Bah, I'll just hack it DoobyWho's Avatar
    Join Date
    Jul 2002
    Posts
    476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, by the way the error message sounds... It seems as though the file couldn't be found. Which I don't understand because its a LOCAL file and isn't hosted on the server.

  5. #5
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe not.... mySQL would still display the file pathname within the error regardless of the error having something to do with the actual location of the file or not ?

    I catch this from the following:
    Code:
    FIELDS TERMINATED BY ';' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\r\n'
    Which shouldn't actually be there correct ? There should in fact be the remaining fields shown as well, after 'Wine'.

    I'd look at the file it's self - it's all *.txt anyway - and see if there is a missing ; (semi-colon) character in there - maybe it's been substituted by a new line and/or return character....

  6. #6
    Bah, I'll just hack it DoobyWho's Avatar
    Join Date
    Jul 2002
    Posts
    476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston
    Maybe not.... mySQL would still display the file pathname within the error regardless of the error having something to do with the actual location of the file or not ?

    I catch this from the following:
    Code:
    FIELDS TERMINATED BY ';' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\r\n'
    Which shouldn't actually be there correct ? There should in fact be the remaining fields shown as well, after 'Wine'.

    I'd look at the file it's self - it's all *.txt anyway - and see if there is a missing ; (semi-colon) character in there - maybe it's been substituted by a new line and/or return character....
    Is there a way to go from excel -> a .txt file seperated by ;'s ? the file is tab delimited.

  7. #7
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure as I've never dealt with excel using the web

    Hope I never do either But since the structure of the excel file is given you should be able to script a solution to it ?


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
  •