Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see full query from SHOW PROCESSLIST

When I issue SHOW PROCESSLIST query, only the first 100 characters of the running SQL query are returned in the info column.

Is it possible to change MySQL config or issue a different kind of request to see complete query (the queries I'm looking at are longer than 100 characters)

like image 808
Ghostrider Avatar asked Sep 03 '10 18:09

Ghostrider


People also ask

How do I see Processlist?

SHOW PROCESSLIST shows you which threads are running. You can also get this information from the information_schema. PROCESSLIST table or the mysqladmin processlist command. If you have the PROCESS privilege , you can see all threads.

What is full Processlist in MySQL?

SHOW [FULL] PROCESSLIST. The MySQL process list indicates the operations currently being performed by the set of threads executing within the server. The SHOW PROCESSLIST statement is one source of process information. For a comparison of this statement with other sources, see Sources of Process Information.

How do I see all MySQL queries?

To list running queries, we need to use the 'show processlist' command. The following is the query. mysql> SHOW processlist; The following is the output of the above query.

How do I view a query in MySQL workbench?

To do that, first select the desired database from the left column menu by double-clicking it. Then type in the MySQL query you want to run in the text field in the middle of the program window and use the yellow lightning button above that text field to run the query.


3 Answers

SHOW FULL PROCESSLIST

If you don't use FULL, "only the first 100 characters of each statement are shown in the Info field".

When using phpMyAdmin, you should also click on the "Full texts" option ("← T →" on top left corner of a results table) to see untruncated results.

like image 86
James McNellis Avatar answered Oct 22 '22 06:10

James McNellis


See full query from SHOW PROCESSLIST :

SHOW FULL PROCESSLIST;

Or

 SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
like image 21
Hasib Kamal Chowdhury Avatar answered Oct 22 '22 05:10

Hasib Kamal Chowdhury


Show Processlist fetches the information from another table. Here is how you can pull the data and look at 'INFO' column which contains the whole query :

select * from INFORMATION_SCHEMA.PROCESSLIST where db = 'somedb';

You can add any condition or ignore based on your requirement.

The output of the query is resulted as :

+-------+------+-----------------+--------+---------+------+-----------+----------------------------------------------------------+
| ID    | USER | HOST            | DB     | COMMAND | TIME | STATE     | INFO                                                     |
+-------+------+-----------------+--------+---------+------+-----------+----------------------------------------------------------+
|     5 | ssss | localhost:41060 | somedb | Sleep   |    3 |           | NULL                                                     |
| 58169 | root | localhost       | somedb | Query   |    0 | executing | select * from sometable where tblColumnName = 'someName' |
like image 133
Yogesh A Sakurikar Avatar answered Oct 22 '22 04:10

Yogesh A Sakurikar