Click to See Complete Forum and Search --> : MySql's truncating my data


johngeorge
02-26-2007, 09:29 AM
Hi there,
I'm having a little issue with MySql and wondering if any of you guys maybe able to help me. I started using it a while ago, and found it nice and easy to set-up with php, but I've just tried to import a csv under instruction of my trusty book, but I'm coming up with errors.

I have a table called 'schedules' in a database called 'intranet':

sched_id -- int
name -- varchar(25)
start -- date


..and a csv like this:

1,name 1,2007-01-01
2,name 2,2007-01-01
3,name 3,2007-01-01
4,name 4,2007-01-01
5,name 5,2007-01-01
6,name 6,2007-01-01


i use this command at a command prompt:

mysqlimport -u root -p --fields-terminated-by=',' intranet schedules.csv


then it says:
mysqlimport: Error: Data truncated for column 'sched_id' at row 1, when using table: schedules


...:confused: what's going on?

John-George