SQL statement timing from MySQL 5.7 client when using a script When I run a SQL statement interactively in a MySQL 5.7 client it tells me how long the query ran:

mysql&gt; select now();
--------------
select now()
--------------

+---------------------+
| now()               |
+---------------------+
| 2018-03-09 14:27:42 |
+---------------------+
1 row in set (0.07 sec)


In this case it ran for 0.07 seconds. 

But when I run the same SQL statement through a script the output does not include the time the statement took.

&gt;mysql -f -v --table -u myuser -pmypassword -h myhost mydb &lt; test.sql

mysql: [Warning] Using a password on the command line interface can be insecure.
--------------
select now()
--------------

+---------------------+
| now()               |
+---------------------+
| 2018-03-09 14:31:00 |
+---------------------+


How can I run a SQL statement from a script and still get back the length of time that it ran using the MySQL 5.7 client?

Thanks!
Bobby
You can use -vvv with mysql command.

mysql -f -vvv --table -u myuser -pmypassword -h myhost mydb &lt; test.sql

&gt; mysql -vvv &lt; mysql.sql 
--------------
select now()
--------------

+---------------------+
| now()               |
+---------------------+
| 2018-03-10 04:08:33 |
+---------------------+
1 row in set (0.00 sec)

Bye


Hope it will fulfill your requirement :)