MySQL statements can be printed along with the output by using the -v option in batch mode. For example, after running the same query in batch mode using the –v option, we will get the statements printed along with the output.
C:\Program Files\MySQL\bin>mysql -u root -p gaurav < hh.sql -v Enter password: ***** -------------- select * from hh -------------- id 1 2
It shows the statement select * from hh, which is written to the file hh.sql.
The above is the detailed content of When running MySQL statements in batch mode, how can we print and output which statements are being executed?. For more information, please follow other related articles on the PHP Chinese website!