Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 9th November 2010, 16:07
mestedup mestedup is offline
Junior Member
 
Join Date: Nov 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default MySQL - Importing text files

I am having problems importing text files into MySQL. I have created a table called GSMaster201011 and I have a file on a network drive, called OUPcust_11_06_2010.TXT.

This is the command I'm using:
Quote:
load data infile '/w/Databases/GlobalSweeps\(OUP\)/Updates/20101106/OUPIcust_11_06_2010.TXT' into table GSMasster201011 fields terminated by '|' enclosed by '"' lines terminated by '\r\n';
and I get this error:
Quote:
ERROR 13 (HY000): Can't get stat of '/w/Databases/GlobalSweeps(OUP)/Updates/20101002/OUPIcust_10_02_2010.TXT' (Errcode: 2)
From what I can find out, this error means that path is incorrect or MySQL cant access the file. I've checked the path and it is correct, so I checked the permissions and this is what I get when I check the files flags:
Quote:
-rwxrwxrwx 1 root root 85496486 2010-11-06 02:35 OUPIcust_11_06_2010.TXT
The only problem is I dont know that much about linux and I dont know what I'm looking at with the above query.

I am logged into locally & MySQL as root.

Please let me know if you need more information.
Reply With Quote
Sponsored Links
  #2  
Old 9th November 2010, 17:40
mestedup mestedup is offline
Junior Member
 
Join Date: Nov 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

I figured it out. I used the "local" option and typed out the path to the file:

Quote:
load data local infile '/home/mnguyen/w/Databases/GlobalSweeps\(OUP\)/Updates/20101106/OUPIcust_11_06_2010.TXT' into table GSMaster201011 fields terminated by '|' enclosed by '"' lines terminated by '\r\n';
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Squirrelmail login failure Cracklefish Installation/Configuration 9 30th June 2010 20:38
Create text files dynamically from master textfile with sed mangecelle Programming/Scripts 1 21st April 2009 04:16
Problem Installing Apache 2.2.8, MySQL 5.0 Client and PHP 5.2.5 On Fedora 8 (64-Bit) asyadiqin Installation/Configuration 5 10th April 2008 18:40
Management/system config/settings & /server/settings not working!! dactor Installation/Configuration 9 6th February 2008 09:11
treat rar files as text Hellbound General 0 14th September 2005 18:27


All times are GMT +2. The time now is 09:29.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.