Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. 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

I've got a large .sql file with large insert into ... values ... statements. Many of these statements are generating warnings during execution. How can I get mysql to print the warnings?

If it hit control-C then the import stops and I'm dropped back to the OS command line.

Here is sample output from running the SQL:

Query OK, 9827 rows affected, 5403 warnings (0.20 sec)
Records: 9827  Duplicates: 0  Warnings: 5403

Query OK, 9859 rows affected, 5247 warnings (0.20 sec)
Records: 9859  Duplicates: 0  Warnings: 5247
share|improve this question
up vote 6 down vote accepted

You should startup mysqld with log-warnings (it should be on by default) and also the max error count


You may have to start the mysql client with


This is not mysqld setting, it's a mysql client session setting.

You may want to add show-warnings to mysql client session

mysql -u... -p -hlocalhost --show-warnings
share|improve this answer
That option does not print these warnings to the server's error log. – tmcallaghan Mar 5 '12 at 18:57
The first suggestion should put warnings in the error log. – RolandoMySQLDBA Mar 5 '12 at 19:00
adding --show-warnings to the mysql client worked like a charm, thanks. – tmcallaghan Mar 5 '12 at 19:03

With the mysql client you can also do:

mysql> tee import.log
mysql> source .\test.sql

then view the import.log file created in the current directory.

share|improve this answer

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.