show processlist host 為 百分號(%)
今天用戶報出來一個問題:
show full processlist;時出現下面的情況:
|
| 46977247 | common | % | common | Connect | 391 | updating |
| 46977311 | common | % | common | Connect | 331 | updating |
| 46977312 | common | % | common | Connect | 330 | updating |
| 46977406 | common | % | common | Connect | 237 | updating |
| 46977413 | common | % | common | Connect | 231 | updating |
| 46977446 | common | % | common | Connect | 201 | updating |
| 46977459 | common | % | common | Connect | 189 | updating |
| 46977462 | common | % | common | Connect | 186 | updating |
| 46977477 | common | % | common | Connect | 171 | updating |
| 46977489 | common | % | common | Connect | 159 | updating |
| 46977490 | common | % | common | Connect | 158 | updating |
| 46977493 | common | % | common | Connect | 155 | updating |
| 46977496 | common | % | common | Connect | 152 | updating |
| 46977511 | common | % | common | Connect | 137 | updating |
| 46977519 | common | % | common | Connect | 129 | updating |
| 46977523 | common | % | common | Connect | 125 | updating |
| 46977526 | common | % | common | Connect | 123 | updating |
| 46977530 | common | % | common | Connect | 119 | updating |
| 46977532 | common | % | common | Connect | 117 | updating |
| 46977533 | common | % | common | Connect | 116 | updating |
| 46977537 | common | % | common | Connect | 113 | updating
host那一列顯示的只是一個 %號,沒有顯示ip地址。
這看起來有點不應該。 想了一下原因:沒有想到,網上也不沒有找到答案。
靈感出現在一瞬間:
使用下面的方式模擬:
delimiter ;;
CREATE DEFINER=`root`@`%` PROCEDURE `insert_pro`()
begin
DECLARE counter INT DEFAULT 0;
insert_loop: loop
set counter=counter+1;
insert into test values (counter,counter,counter);
if counter=10000 then
leave insert_loop;
end if;
end loop insert_loop;
end
;;
CREATE EVENT IF NOT EXISTS e_test
ON SCHEDULE EVERY 10 SECOND
ON COMPLETION PRESERVE
DO CALL test.insert_pro();
然后去show full processlist;
mysql> show full processlist;
+----+-----------------+-----------------+------+---------+------+-----------------------------+----------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+-----------------+-----------------+------+---------+------+-----------------------------+----------------------------------------------------+
| 1 | event_scheduler | localhost | NULL | Daemon | 2 | Waiting for next activation | NULL |
| 64 | root | localhost:34176 | test | Sleep | 52 | | NULL |
| 65 | root | localhost:34177 | NULL | Query | 0 | System lock | show full processlist |
| 74 | root | % | test | Connect | 0 | query end | insert into test values (counter,counter,counter) |
| 75 | root | % | test | Connect | 0 | query end | insert into test values (counter,counter,counter) |
+----+-----------------+-----------------+------+---------+------+-----------------------------+----------------------------------------------------+
5 rows in set (0.00 sec)
可以模擬出這種情況。
其實就是event調用的結果。
轉載請注明源出處
QQ 273002188 歡迎一起學習
QQ 群 236941212
oracle,mysql,mongo 相互交流