Difference Between MySQL Output Formats in Batch and Interactive Modes



The default MySQL output would be different if we will run the same query interactively or in batch mode. For example, if we will run the query select * from hh interactively then following would be a format of output −

mysql> select * from hh;

+------+
| id   |
+------+
|  1   |
|  2   |
+------+
2 rows in set (0.01 sec)

On the other hand, if we will run the same query in batch mode then following would be the format of output −

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

id
1
2
Updated on: 2020-06-22T04:58:48+05:30

86 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements