Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
BEGIN;
INSERT;
COMMIT;

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
add comment

1 Answer

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
--------------

Database
information_schema
mysql
--------------
show tables
--------------

Tables_in_mysql
columns_priv
db
event
.....
share|improve this answer
add comment

Your Answer

 
discard

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.