Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

To start off, this is not about loading data from within mysql itself, but using the command-line tool "mysqlimport".

I am using it to load a CSV directly into a table and need to see the warnings it has generated. I cannot seem to get warnings to display with verbose nor debugging turned on. Any ideas?

(mysql 5.0.5)

share|improve this question
up vote 18 down vote accepted

Yeah, this was a nuisance I had to deal with a while ago. Here's a snippet from a script that dealt with converting a bunch of CSV files into mysql tables:

COLLIST=`head -1 $table.csv`

The magic is (as Eduard previously mentioned) is to execute the LOAD DATA INFILE and the SHOW WARNINGS commands together in the same session, as mysqlimport doesn't provide a way to get at the warnings directly.

share|improve this answer
Sweet, thank you! I had just begun writing a statement like this after seeing Eduard's comment. Thanks yo! Thanks – brink Dec 21 '09 at 19:50
Does this work if tables.csv is a local file (i.e., not on the server of the database)? – Raffi Khatchadourian Jun 7 at 18:00

Like the others said the real problem is that for SHOW WARNINGS to work you have to be in the same connected session. mysqlimport disconnects from the session as soon as it's finished importing, making the capture of it's warnings impossible in it's current version. Sounds like an opportunity to donate a patch. :)

share|improve this answer

I've found no way to print warnings with mysqlimport either. But since mysqlimport does nothing but "LOAD DATA INFILE" why don't you use the mysql command to import the data followed by a "SHOW WARNINGS"?

share|improve this answer
Thanks! Kind of irritating mysqlimport doesn't really play nice :/ – brink Dec 21 '09 at 19:51
Use the "SHOW WARNINGS;" command after "LOAD". – Eduard Wirch Dec 27 '09 at 15:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.