2012-06-19 173 views
3

下列要求:解釋MySQL查詢日誌

select * from mysql.general_log order by event_time desc

它爲什麼會出現 「拒絕訪問」 如此頻繁?似乎它每兩秒鐘就會嘗試這樣做。這是一個錯誤還是爲什麼發生這種情況,這是什麼意思?

| user_host     | thread_id | server_id | command_type | argument               | 
+---------------------------+-----------+-----------+--------------+-------------------------------------------------------------------+ 
| root[root] @ localhost [] |  122 |   0 | Query  | select * from mysql.general_log order by event_time desc   | 
| [] @ localhost []   |  223 |   0 | Connect  | Access denied for user 'dave'@'localhost' (using password: NO) | 
| [dave] @ localhost [] |  223 |   0 | Connect  | [email protected] as on           | 
| [] @ localhost []   |  222 |   0 | Connect  | Access denied for user 'dave'@'localhost' (using password: NO) | 
| [dave] @ localhost [] |  222 |   0 | Connect  | [email protected] as on           | 
| [] @ localhost []   |  221 |   0 | Connect  | Access denied for user 'dave'@'localhost' (using password: NO) | 
| [dave] @ localhost [] |  221 |   0 | Connect  | [email protected] as on           | 
| [] @ localhost []   |  220 |   0 | Connect  | Access denied for user 'dave'@'localhost' (using password: NO) | 
| [dave] @ localhost [] |  220 |   0 | Connect  | [email protected] as on           | 
| [] @ localhost []   |  219 |   0 | Connect  | Access denied for user 'dave'@'localhost' (using password: NO) | 
| [dave] @ localhost [] |  219 |   0 | Connect  | [email protected] as on           | 
| [] @ localhost []   |  218 |   0 | Connect  | Access denied for user 'dave'@'localhost' (using password: NO) | 
| [dave] @ localhost [] |  218 |   0 | Connect  | [email protected] as on           | 
| [] @ localhost []   |  217 |   0 | Connect  | Access denied for user 'dave'@'localhost' (using password: NO) | 
| [dave] @ localhost [] |  217 |   0 | Connect  | [email protected] as on           | 
| [] @ localhost []   |  216 |   0 | Connect  | Access denied for user 'dave'@'localhost' (using password: NO) | 
| [dave] @ localhost [] |  216 |   0 | Connect  | [email protected] as on           | 
| [] @ localhost []   |  215 |   0 | Connect  | Access denied for user 'dave'@'localhost' (using password: NO) | 
+0

哪些進程已經打開MySQL sock進行寫入? ('fuser'或'lsof'可以顯示你。) – sarnold

+0

'mysqld 15806 _mysql 21u IPv4 0xffffff600c106a40 0t0 TCP *:mysql(LISTEN)' – David542

+0

您有沒有嘗試過,或許後來放棄了設置複製? –

回答

1

由於錯誤消息顯示,有人試圖從本地計算機以dave連接到服務器,而無需使用密碼。我假設戴夫帳戶不存在,存在但限制爲IP或存在密碼。

如果是複製,你不會看到'dave'@'localhost'被拒絕訪問,它會是'dave'@'someotherserver'(除非你有兩個mysql進程在同一臺服務器上運行)。

如果是普通的事情,那我先看看cron;看看有沒有什麼經常試圖連接到MySQL。