MySQL Security – DELAYED User at MySQL

insertMySQLprocessSecurity

mysql> show processlist;

| Id    | User    | Host                    | db           | Command        | Time | State              | Info             |
| 27098 | DELAYED | localhost | placeholder | Delayed insert | 111 | Waiting for INSERT | |

I'm finding this process as suspicious, but nothing in ps, netstat, cron.
How to get more info about that process? Thanks.

Best Answer

Once someone executes INSERT DELAYED, a system thread will open in order to track and mitigate INSERTs of this kind. MySQL 5.6 deprecates it and 5.7 does not support it.

What is more, in terms of MySQL Replication, Slaves will completely ignore an INSERT DELAYED command from a Master and execute them as a standard INSERT.

Please read the MySQL 5.5 Documentation on this for further info.

UPDATE 2016-07-05 11:30 EDT

Since you are interested in process/client, which originates this "INSERT DELAYED" query, you should look at the thread states. The MySQL 5.5 Documentation describes them well:

States associated with a connection thread that processes an INSERT DELAYED statement from the client:

  • allocating local table : The thread is preparing to feed rows to the delayed-insert handler thread.

  • Creating delayed handler : The thread is creating a handler for DELAYED inserts.

  • got handler lock : This occurs before the allocating local table state and after the waiting for handler lock state, when the connection thread gets access to the delayed-insert handler thread.

  • got old table : This occurs after the waiting for handler open state. The delayed-insert handler thread has signaled that it has ended its initialization phase, which includes opening the table for delayed inserts.

  • storing row into queue : The thread is adding a new row to the list of rows that the delayed-insert handler thread must insert.

  • waiting for delay_list : This occurs during the initialization phase when the thread is trying to find the delayed-insert handler thread for the table, and before attempting to gain access to the list of delayed-insert threads.

  • waiting for handler insert : An INSERT DELAYED handler has processed all pending inserts and is waiting for new ones.

  • waiting for handler lock : This occurs before the allocating local table state when the connection thread waits for access to the delayed-insert handler thread.

  • waiting for handler open : This occurs after the Creating delayed handler state and before the got old table state. The delayed-insert handler thread has just been started, and the connection thread is waiting for it to initialize.

States associated with a delayed-insert handler thread that inserts the rows:

  • insert : The state that occurs just before inserting rows into the table.

  • reschedule : After inserting a number of rows, the delayed-insert thread sleeps to let other threads do work.

  • upgrading lock : A delayed-insert handler is trying to get a lock for the table to insert rows.

  • Waiting for INSERT : A delayed-insert handler is waiting for a connection thread to add rows to the queue (see storing row into queue).