1

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?

1 Answer 1

5

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.