
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How can I see how long statements take to execute on the MySQL command line?
For every single statement on MySQL command line, it shows the exact time to execute the specific statement.
Let us first create a table −
mysql> create table DemoTable1589 -> ( -> EmployeeId int, -> EmployeeName varchar(20) -> ); Query OK, 0 rows affected (0.56 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable1589 values(101,'Sam'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable1589 values(102,'Bob'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable1589 values(103,'David'); Query OK, 1 row affected (0.16 sec)
Display all records from the table using select statement −
mysql> select * from DemoTable1589;
This will produce the following output −
+------------+--------------+ | EmployeeId | EmployeeName | +------------+--------------+ | 101 | Sam | | 102 | Bob | | 103 | David | +------------+--------------+ 3 rows in set (0.04 sec)
- Related Articles
- How to execute Python multi-line statements in the one-line at command-line?
- How can I execute JavaScript at the command prompt?
- How to open MySQL command line on Windows10?
- How to see spaces in data when selecting with MySQL command line client?
- How can we return to windows command shell from MySQL command line tool?
- How to create a database on command line in MySQL?
- How to display the value of a variable on command line in MySQL?
- How can I see global locks in MySQL (innodb)?
- How to repair MySQL tables from the command line?
- How can I see the description of a MySQL Temporary Tables?
- How to upgrade MySQL server from command line?
- How to adjust display settings of MySQL command line?
- How to display records vertically in MySQL command line?
- How to list databases vertically in MySQL command line?
- How is it possible to enter multiple MySQL statements on a single line?

Advertisements