15

This article: http://www.linuxask.com/questions/how-to-show-the-warnings-during-mysqlimport

says it is not possible to show warnings when using mysqlimport:

When you use mysqlimport to import data from text file, the number of warnings will be displayed at the end of import. But there is no way to show the actual warnings message.

Is that accurate? I have a server which does not allow LOAD DATA INFILE.

jerrygarciuh
  • 21,158
  • 26
  • 82
  • 139
  • Do you have reason to believe it's not accurate? – Pekka Oct 03 '11 at 22:24
  • 1
    No, none. But I want very much for it to be inaccurate. It seems a bit crazy that mysqlimport would show you that warnings were created but that there would be no way whatsoever to see what they were. – jerrygarciuh Oct 03 '11 at 22:49
  • It's got a verbose mode and a debugging log - maybe one of those helps? http://dev.mysql.com/doc/refman/5.0/en/mysqlimport.html – Pekka Oct 03 '11 at 22:51
  • I've been using verbose. I'll try the logging, thanks! – jerrygarciuh Oct 05 '11 at 00:04
  • 1
    @Pekka웃 the debugging log with `--debug=filename.log` was not working, it looks like it is just enabled for debug builds: https://bugs.mysql.com/bug.php?id=66854 – baptx Dec 05 '17 at 15:51

2 Answers2

12

The answer is - no you cannot output warnings from mysqlimport.

jerrygarciuh
  • 21,158
  • 26
  • 82
  • 139
10

I used the mysql CLI tool, passing an equivalent "LOAD DATA ..." command followed by a semicolon, followed by "SHOW WARNINGS". The resulting display is helpful in finding detail on each warning.

For example:

mysql <options> -e "LOAD DATA LOCAL INFILE 'foo' INTO TABLE bar; SHOW WARNINGS"
bobchase
  • 219
  • 3
  • 3