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

I'm a long time postgres user, but am now looking after maintenance for mysql databases. One thing that I'm used to from postgres, is when you run a sql script it will output on the command line what it is executing.. i.e.

cat myscript.sql | psql mydatabase

When I do a similar thing with mysql, I get no output and it will just churn away without giving me any status

cat myscript.sql | mysql mydatabase

Are there any flags I can use or something to the mysql binary so I can get an idea of whats going on when the script is executing?

share|improve this question

You can use the -v switch to turn on verbose mode which will display the commands as they are executed.

chris@eden:~$ mysql -v -uroot -p < mysqltest
Enter password:
show databases

show tables

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.