Unix Technical Forum

can't import TIME type w/mysqlimport

This is a discussion on can't import TIME type w/mysqlimport within the MySQL forums, part of the Database Server Software category; --> Hi - I'm using server 5.0.19 on kernel 2.6.9.11. I was trying to use mysqlimport to import from a ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 07:29 AM
cartine@gmail.com
 
Posts: n/a
Default can't import TIME type w/mysqlimport

Hi -

I'm using server 5.0.19 on kernel 2.6.9.11.

I was trying to use mysqlimport to import from a local file into a
table. It kept barfing on a time field. So just to isolate the problem,
i reformatted the file to contain only records as follows:

2006-03-13,09:13:26
2006-03-13,10:16:02

when i select * from the table i can see that only the dates were
imported, but not the time.

this is the SQL command I used to create the table:
CREATE TABLE datetime (date DATE, time TIME, INDEX(date), INDEX(time));

any suggestions?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 07:29 AM
Bill Karwin
 
Posts: n/a
Default Re: can't import TIME type w/mysqlimport

<cartine@gmail.com> wrote in message
news:1142522190.019797.284630@i39g2000cwa.googlegr oups.com...
> I was trying to use mysqlimport to import from a local file into a
> table. It kept barfing on a time field. So just to isolate the problem,
> i reformatted the file to contain only records as follows:
>
> 2006-03-13,09:13:26
> 2006-03-13,10:16:02


This worked for me:
mysqlimport -u root -p --fields-terminated-by=, -v test datetime.txt

This was using MySQL 5.0.18 on Windows XP Pro, executing mysqlimport from a
DOS command shell.

Can you be more specific regarding the failure? Was there any error
message, or did it just silently fail to insert some values? Is your file
in DOS format (newlines terminated by \r\n)?

Regards,
Bill K.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:13 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com