MySQL 无法启动服务器:绑定在 TCP/IP 端口上:无法分配请求的地址

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14908430/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 16:36:21  来源:igfitidea点击:

Can't start server: Bind on TCP/IP port: Cannot assign requested address

mysqlubuntu

提问by redice

I rebooted my server yesterday, unfortunately mysql cannot be started now.

我昨天重新启动了我的服务器,不幸的是现在无法启动 mysql。

The error log is as following:

错误日志如下:

root@site-digger:/var/log/mysql# cat error.log 
130216 16:11:32 [Note] Plugin 'FEDERATED' is disabled.
130216 16:11:32  InnoDB: Initializing buffer pool, size = 8.0M
130216 16:11:32  InnoDB: Completed initialization of buffer pool
130216 16:11:33  InnoDB: Started; log sequence number 0 1382359817
130216 16:11:33 [ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address
130216 16:11:33 [ERROR] Do you already have another mysqld server running on port: 3306 ?
130216 16:11:33 [ERROR] Aborting

130216 16:11:33  InnoDB: Starting shutdown...
130216 16:11:38  InnoDB: Shutdown completed; log sequence number 0 1382359817
130216 16:11:38 [Note] /usr/sbin/mysqld: Shutdown complete
...

I checked and didn't find any program is using 3306, please see following.

我查了一下,没有发现任何程序在使用3306,请看下面。

root@site-digger:/var/log/mysql# sudo netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 site-digger.com:59367   li566-52.members.li:ssh ESTABLISHED
tcp        0      0 site-digger.com:ssh     61.150.56.248:65255     ESTABLISHED
tcp        0    216 site-digger.com:ssh     61.150.56.248:61553     ESTABLISHED
tcp        0      0 site-digger.com:www     1.82.9.18:55526         TIME_WAIT  
Active UNIX domain sockets (w/o servers)
Proto RefCnt Flags       Type       State         I-Node   Path
unix  2      [ ]         DGRAM                    600880492 
unix  3      [ ]         STREAM     CONNECTED     600845962 
unix  3      [ ]         STREAM     CONNECTED     600845961 
unix  3      [ ]         STREAM     CONNECTED     600596531 
unix  3      [ ]         STREAM     CONNECTED     600596530 

I tried sudo mysql start. But still not working. OS: Ubuntu 11.10

我试过 sudo mysql start。但仍然无法正常工作。操作系统:Ubuntu 11.10

The results for netstat -a -t is as following:

netstat -a -t 的结果如下:

root@site-digger:/var/log/mysql# netstat -a -t
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 *:www                   *:*                     LISTEN     
tcp        0      0 *:ssh                   *:*                     LISTEN     
tcp        0      0 *:https                 *:*                     LISTEN     
tcp        0  20824 site-digger.com:59367   li566-52.members.li:ssh ESTABLISHED
tcp        0      0 site-digger.com:ssh     61.150.56.248:65255     ESTABLISHED
tcp        0     52 site-digger.com:ssh     61.150.56.248:61553     ESTABLISHED
tcp        0      0 site-digger.com:www     crawl-66-249-73-2:45760 TIME_WAIT  
tcp        0      0 site-digger.com:www     218.30.103.146:49094    TIME_WAIT  
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN     

采纳答案by Marc B

Port 33 06. not 60. Netstat only shows active connections, not idle ones which are merely listening. You need netstat -a -t(to show only tcp ports).

端口 33 06。不是60。Netstat 仅显示活动连接,而不显示仅在侦听的空闲连接。您需要netstat -a -t(仅显示 tcp 端口)。