# how to give path of the file in load data file syntax

**URL:** <https://forums.percona.com/t/how-to-give-path-of-the-file-in-load-data-file-syntax/872>\
**Category:** Other MySQL® Questions\
**Created:** [August 8, 2008, 12:41am UTC](https://forums.percona.com/t/how-to-give-path-of-the-file-in-load-data-file-syntax/872 "2008-08-08T00:41:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudhir](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@sudhir](https://forums.percona.com/u/sudhir)\
**Post date:** [August 8, 2008, 12:41am UTC](https://forums.percona.com/t/how-to-give-path-of-the-file-in-load-data-file-syntax/872/1 "2008-08-08T00:41:51Z")

</div>

Hi All,

can anyone please tell me how i can provide the path of the file(from which i want to load data) in load data infile syntax.

I m using mysql on linux platform and made a querry as follows.

LOAD DATA INFILE “MyFile” INTO TABLE TB\_MRR FIELDS TERMINATED BY ‘,’ IGNORE 1 LINES (NodeName, RecordId, resolution, opc, OrigRsId, origRsName, dpc, DestRsId, destRsName, finalDpc, finalRsId, finalRsName, si, gttDone, icLsId, icLsName, ogLsId, ogLsName, icNumSifOct, ogNumSifOct, icSsn, icGtDigits, icGtFrmt, icTT, ogSsn, ogGtDigits, ogGtFrmt, ogTT, isMsgSnt, msgTypeRx, msgTypeTx, svcMsgType);

executing above caommand gives the error as below.  
ERROR 1105 (HY000): File ‘/var/lib/mysql/m7db/MyFile’ not found (Errcode: 2)

---

<div class="post-metadata">

**Author:** ![sweet](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@sweet](https://forums.percona.com/u/sweet)\
**Post date:** [August 8, 2008, 2:16am UTC](https://forums.percona.com/t/how-to-give-path-of-the-file-in-load-data-file-syntax/872/2 "2008-08-08T02:16:58Z")

</div>

input an absolute or relative pathname before a filename.

here is an example.

LOAD DATA INFILE “/MyPath/MyFile” INTO TABLE TB\_MRR FIELDS TERMINATED BY ‘,’ IGNORE 1 LINES (NodeName, RecordId, resolution, opc, OrigRsId, origRsName, dpc, DestRsId, destRsName, finalDpc, finalRsId, finalRsName, si, gttDone, icLsId, icLsName, ogLsId, ogLsName, icNumSifOct, ogNumSifOct, icSsn, icGtDigits, icGtFrmt, icTT, ogSsn, ogGtDigits, ogGtFrmt, ogTT, isMsgSnt, msgTypeRx, msgTypeTx, svcMsgType);

it’s simple.

---

<div class="post-metadata">

**Author:** ![sudhir](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@sudhir](https://forums.percona.com/u/sudhir)\
**Post date:** [August 8, 2008, 2:53am UTC](https://forums.percona.com/t/how-to-give-path-of-the-file-in-load-data-file-syntax/872/3 "2008-08-08T02:53:12Z")

</div>

thank you so much sweet .

i tried as u suggested it works fine when i m giving the command within mysql\> LOAD… .but actually i m trying the same comand using mysql\_query(query\_string)function,where query\_string contains the same command as above.  
In that case an error message is raised :  
ERROR: Error while querying database insertion - File '/Mypath/MyFile  
’ not found (Errcode: 2).
