MySQL – When Command column in Processlist shows “Prepare” or “execute”

MySQL

Can someone please highlight when a "Command" shows "Prepare" or "Execute" for "Show Full Processlist"

Any example which shows this would be helpful.

Best Answer

The command status you refer to is pretty self explanatory:

1) The thread is preparing a statement, for example when the following:

PREPARE STATEMENT my_stmt FROM 'SELECT * FROM countries WHERE id = ?'; 

2) The thread ist executing a formerly prepared statement:

EXECUTE my_stmt;

You can also refer to the documentation: Thread Command Values