close

今天要將MySQL啟動時,

出現1067的錯誤,

因為之前也有出現相同情形,

就把ib_logfile0與ib_logfile1刪除,

再次啟動,

卻還出現1067的錯誤,

打開副檔名為err的檔案(跟資料庫是放在一起的,你的電腦名稱.err),

101207 13:56:09 [Note] Plugin 'FEDERATED' is disabled.
101207 13:56:11  InnoDB: Started; log sequence number 0 1125596322
101207 13:56:11 [ERROR] Do you already have another mysqld server running on port: 3306 ?
101207 13:56:11 [ERROR] Aborting

101207 13:56:11  InnoDB: Starting shutdown...
101207 13:56:17  InnoDB: Shutdown completed; log sequence number 0 1125596322
101207 13:56:17 [Note] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: Shutdown complete

重點在「Do you already have another mysqld server running on port: 3306 ?」這個訊息,

意思是有其他程式將port 3306佔用了,

用netstat來檢視port 3306發現狀態是Close_Wait,

因為前幾天都還可以啟動,

就把這幾天安裝的程式刪除,

卻還是出現同樣的錯誤訊息,

因為實在沒什麼時間去檢查那個程式去佔用port 3306,

所以我就將預設port 3306變更為3307(如何執行?執行MySQL Server Instance Config Wizard,在「Please set the networking options.」的頁籤中就可選你要的port),

後面如果重新啟動服務可正常執行即是更改成功,

如果你是使用asp.net,

請至web.config,

在MySQL的connectionstring中,

必須加上port=3307,

不然會出現錯誤訊息(無法連線,因為目標電腦拒絕連線。127.0.0.1:3306)。
 

 

arrow
arrow
    全站熱搜

    souts 發表在 痞客邦 留言(0) 人氣()