Home  >  Article  >  Database  >  When running MySQL statements in batch mode, how can we print and output which statements are being executed?

When running MySQL statements in batch mode, how can we print and output which statements are being executed?

WBOY
WBOYforward
2023-09-12 23:45:021272browse

在批处理模式下运行 MySQL 语句时,我们如何打印以及输出正在执行哪些语句?

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!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete