Mysql – How to force the MySQL client to output to stdout or a log file when importing a SQL file

importloggingMySQL

Let's say I am importing a small SQL file using the MySQL client like so:

mysql < 10k-file.sql

The mysql client does not output anything. How can I force it to show how many rows are affected for each query, errors, so on?

Best Answer

You can use the general log

so enable general log

but be careful this will log everything what happens and gets fast big