MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old August 8th, 2000, 11:40 AM
cryogen cryogen is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: halifax
Posts: 13 cryogen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hi there...
trying to get a mysqlimport working here...Driving me nuts!
using : mysqlimport -u root -p -fields-enclosed-by=, -fields-optionally-terminated-by=" DB c:/brand.txt;
this keeps returning :
mysqlimport: invalid option -- e
--e????@?!?!?!?!! wtf
im really lost here....from all the sources i've checked, this syntax is correct! is there any other steps i might be missing????
thks
cryogen

------------------
i'm trying...REALLY!

[This message has been edited by cryogen (edited August 08, 2000).]

Reply With Quote
  #2  
Old August 8th, 2000, 02:01 PM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Pembroke Pines, Florida, USA
Posts: 2,300 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 3 h 2 m 4 sec
Reputation Power: 44
I believe this should be

mysqlimport -u root -p --fields-enclosed-by=, --fields-optionally-terminated-by=" DB c:/brand.txt;

(notice the "--" in front of the multi-word arguments)

NOW... the real question: why are you 'optionally' terminating your fields by quotes? I've never heard of fields being _optionally_ terminated by anything, but often fields with text content are optionally _enclosed_ by quotes, before the field terminator.

Maybe you should try:

mysqlimport -u root -p --fields-optionally-enclosed-by=" --fields-terminated-by=, DB c:/brand.txt;

Are you importing an Access table? If so, there is an excellent utility to convert a whole Access database to SQL script that will run in MySQL to recreate that database. (http://download.sourceforge.net/mirrors/mysql/Contrib/exportsql.txt)

Also look at http://www.mysql.com/downloads/contrib.html#SEC466 for some other conversion utilities.

Reply With Quote
  #3  
Old August 9th, 2000, 08:57 AM
cryogen cryogen is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: halifax
Posts: 13 cryogen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hrm....the optionally terminated was a typo :| hehe
however, the command you posted still does nothing, i type in:
mysqlimport -u root -p --fields-optionally-enclosed-by=" --fields-terminated-by=, DB c:/brand.txt;
and all i get is the information screen!
grrrrrrrrrrr
cryogen

Reply With Quote
  #4  
Old August 9th, 2000, 12:38 PM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Pembroke Pines, Florida, USA
Posts: 2,300 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 3 h 2 m 4 sec
Reputation Power: 44
I haven't had a chance to use mysqlimport lately, but I think your problem might be that you need to enclose your separator characters with single quotes as in

--fields-optionally-enclosed-by='"' --fields-terminated-by=',' etc....

Also, I assume that since your textfile is brand.txt, that the table you are loading into is called 'brand'. You probably know this, but in mysqlimport strips the extension of the filename and uses the filename as the tablename.

Other than that, I don't know what the problem could be, but one nice solution is to use phpMyAdmin, (get it at www.phpwizard.net ), a web-based MySQL admin kit using PHP, that lets you import and export data easily.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > mysqlimport


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway