PhpMyAdmin insert textfile error..

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
grassmole
Forum Newbie
Posts: 3
Joined: Tue Mar 25, 2003 3:54 pm

PhpMyAdmin insert textfile error..

Post by grassmole »

I have looked for a fix and see many similar posts, but none that make any sense. I am trying to insert a text file in to MySql using PhpMyAdmin and get this error:
==================
Error

SQL-query :

LOAD DATA LOCAL INFILE '' INTO TABLE `tek` FIELDS TERMINATED BY ';' ENCLOSED BY '"' ESCAPED BY '\'' LINES TERMINATED BY '\r\n'

MySQL said:


File '' not found (Errcode: 2)
============
Cant seem to upload any text files. Looks like my file that I specified is not being passed either.

PHP Version: 4.2.3
MySql api version: 3.23.39
Apache Version: Apache/1.3.24

PLEASE HELP?

Thanks,
Mole
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

I'm having the exact same problem - there must be a bug in phpMyAdmin somewhere.

It's been annoying me but I haven't looked for a fix yet (have you tried the latest version of phpMyAdmin?), I've just been opening the file selecting all the info and pasting it into the SQL box in phpMyAdmin.

Since this is pointless I'll try upgrading my version see if that helps and if it doesn't I'm sure there must be a fix...

Just out of interest are you on Windows or *nix?

Mac
grassmole
Forum Newbie
Posts: 3
Joined: Tue Mar 25, 2003 3:54 pm

I think I am getting somewhere

Post by grassmole »

I used an installer package to load php, mysql and apache. In phpinfo(), it said my mysql version was 3.2. Not the case, it was 4.1. I unloaded it and reloaded mysql 4.0, and now do not get the error, just a bad upload. This is good cause one more error and Im pitching the whole project, not really.....

I am on win 2k.

Final: I think this error is a mysql 4.1 error, having to do with the way backslashes are recognized in php?


MoLe
grassmole
Forum Newbie
Posts: 3
Joined: Tue Mar 25, 2003 3:54 pm

Post by grassmole »

ok, looks like I got a fix. Here is what I had to do:
1. clear mysql 4.1, load mysql 4.0
2. save textfile as csv.
3. Use phpmyadmin with [ Fields terminated by ","].

Upload works....

Mole
Post Reply