473,386 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

LOAD DATA INFILE issue

Hi, im facing a problem here. First of all here is my program
requirement. I got a .csv file with thousands of records inside, i need
to import them into my mysql database. So i tried using load data
infile on my pc using localhost everything goes fine, but when i change
the connection to my server, it seems tat the connection cant be
done... so wat went wrong?

Jun 7 '06 #1
5 1871
Justin wrote:
Hi, im facing a problem here. First of all here is my program
requirement. I got a .csv file with thousands of records inside, i need
to import them into my mysql database. So i tried using load data
infile on my pc using localhost everything goes fine, but when i change
the connection to my server, it seems tat the connection cant be
done... so wat went wrong?


Hi,

I guess LOAD DATA INFILE is a mysql command that loads data from a file into
the db, right?
If that is working on server1 and not on server2, I guess server2 uses
different logincredentials (different username or password).
OR you have a problem with readpermissions.
Can the mySQL user READ the .csv file?

*nix
chmod the csv file to 777 if this a one time action.
If you need to do this a lot, set the ReadWriteExecute to the csv file to a
more appropriate (restricted) level.

W$
Get the properties->security and make sure the file can be read by the
process that runs mysql.

Regards,
Erwin Moller
Jun 7 '06 #2
Justin wrote:
Hi, im facing a problem here. First of all here is my program
requirement. I got a .csv file with thousands of records inside, i
need to import them into my mysql database. So i tried using load data
infile on my pc using localhost everything goes fine, but when i
change the connection to my server, it seems tat the connection cant
be done... so wat went wrong?


Maybe your server only allows MySQL connections from localhost. This is
quite common.
Jun 7 '06 #3
Justin wrote:
Hi, im facing a problem here. First of all here is my program
requirement. I got a .csv file with thousands of records inside, i need
to import them into my mysql database. So i tried using load data
infile on my pc using localhost everything goes fine, but when i change
the connection to my server, it seems tat the connection cant be
done... so wat went wrong?


Maybe you should try a mysql newsgroup such as comp.databases.mysql.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 7 '06 #4
On Wed, 07 Jun 2006 02:20:19 -0700, Justin wrote:
Hi, im facing a problem here. First of all here is my program
requirement. I got a .csv file with thousands of records inside, i need
to import them into my mysql database. So i tried using load data infile
on my pc using localhost everything goes fine, but when i change the
connection to my server, it seems tat the connection cant be done... so
wat went wrong?


Could be any number of things from a network issue to a database
permissions issue. Are you getting any specific error message?

--
The USA Patriot Act is the most unpatriotic act in American history.
Feingold-Obama '08 - Because the Constitution isn't history,
It's the law.

Jun 7 '06 #5
thanx. i fixed the problem eventually... there was an mysql error code
2 i think. it couldn read the csv file at first... so i uploaded the
csv file into the ftp and tried for a few times and it was done... i
think i was lucky though... so wat's the diff between load data local
infile and load data infile??

Ivan Marsh wrote:
On Wed, 07 Jun 2006 02:20:19 -0700, Justin wrote:
Hi, im facing a problem here. First of all here is my program
requirement. I got a .csv file with thousands of records inside, i need
to import them into my mysql database. So i tried using load data infile
on my pc using localhost everything goes fine, but when i change the
connection to my server, it seems tat the connection cant be done... so
wat went wrong?


Could be any number of things from a network issue to a database
permissions issue. Are you getting any specific error message?

--
The USA Patriot Act is the most unpatriotic act in American history.
Feingold-Obama '08 - Because the Constitution isn't history,
It's the law.


Jun 9 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Pieter Van Waeyenberge | last post by:
Hello i have most recent php & mysql versions running on a linuxmachine i want to use LOAD DATA LOCAL INFILE and pass it from php to mysql. - the file i load is given with full path and the...
14
by: Bruce A. Julseth | last post by:
When I execute this SQL statement in my PHP code, I get an error "File '.\Address.txt' not found (Errcode: 2)" $File = addslashes(".\Address.txt"); $SQL = "Load Data InFile \"" . $File . "\"...
3
by: Otto | last post by:
Hello to all I have a problem how to write correctly a PHP string. I did the following import with the help of PHPMyAdmin: Nombre d'enregistrements insérés : 364 (traitement: 0.0553 sec.)...
3
by: hall | last post by:
I have a problem with my design of a templatized class. I'm trying to figure out how to load and save the data inside it, but can't. My class looks like this ------------------------------------...
0
by: Donald Tyler | last post by:
Then the only way you can do it that I can think of is to write a PHP script to do basically what PHPMyAdmin is trying to do but without the LOCAL in there. However to do that you would need to...
1
by: Jami Bradley | last post by:
HI all, For the past several months we have been using LOAD DATA LOCAL INFILE to bulk load tables within Perl modules. Recently, someone thought it would be a good idea to upgrade the Solaris...
1
by: Ray in HK | last post by:
What are the differences between LOAD DATA INFILE and LOAD DATA LOCAL INFILE ? I found some web hosting company do not allow using LOAD DATA INFILE but allow LOAD DATA LOCAL INFILE. The reason...
3
by: nsh | last post by:
mailing.database.mysql, comp.lang.php subject: does "LOAD DATA" EVER work?!? I've tried EVERYTHING! version info: my isp is running my web page on a linux box with php ver. 4.4.1 according to...
0
by: lanesbalik | last post by:
hi all, right now i'm trying to migrate from db2 running under linux to mysql v5.1. i manage to export out the db2 structure & data into a del (ascii) file. but when i try to load the data...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.