由於連接埠問題導致mysql服務沒有起來

來源:互聯網
上載者:User

標籤:由於連接埠問題導致mysql服務沒有起來


今天一同事說他的mysql資料庫起不來了,很是鬱悶,報錯如下

# /etc/init.d/mysql start
Starting MySQL.... ERROR! The server quit without updating PID file (/data/mysql/mysql3306/data/mysql.pid).


我第一時間想到要看錯誤記錄檔,錯誤記錄檔如下:

# vim error.log 
2017-05-04T13:35:17.965606Z 0 [ERROR] Can‘t start server: Bind on TCP/IP port: Permission denied
2017-05-04T13:35:17.965643Z 0 [ERROR] Do you already have another mysqld server running on port: 1005 ?
2017-05-04T13:35:17.965674Z 0 [ERROR] Aborting

(1)首先第一反應是許可權不足,通過排查,使用者權限足夠,mysql資料目錄所有者和所屬組都是mysql,故排除;

(2)報錯第二句表明可能存在mysql服務佔用1005連接埠,於是通過ss -nltup|grep mysql命令查看結果是並沒有任何mysql服務。

(3)最後上網百度了很多,都無果,突然有個想法,mysql的連接埠範圍包含1005嗎?於是查看手冊發現如下:

--port=port_num
The port number that the server should use when listening for TCP/IP connections. The port number
must be 1024 or higher unless the server is started by the root system user.

手冊寫的很是清楚,mysql的port範圍是大於等於1024,費了那麼長的時間,才發現原來人家手冊早就寫死了,真實吃力不討好,還是老老實實用預設連接埠,多多閱讀手冊吧。

本文出自 “10979687” 部落格,請務必保留此出處http://10989687.blog.51cto.com/10979687/1933662

由於連接埠問題導致mysql服務沒有起來

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.