Print Executed MySQL Statements in Batch Mode



By using –v option in batch mode, the MySQL statements can be printed along with output. For example, after running the same query in batch mode with –v option we will get the statement printed along with output.

C:\Program Files\MySQL\bin>mysql -u root -p gaurav < hh.sql -v
Enter password: *****

--------------
select * from hh
--------------
id
1
2

It is showing the statement select * from hh which is written in the file hh.sql.

Updated on: 2020-02-11T08:30:25+05:30

259 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements