MySQL守护进程拒绝以“无法启动服务器:在TCP / IP端口上绑定:已在使用的地址”(它不是)开始。

时间:2012-07-30 16:35:29

标签: mysql database daemon dedicated-server

好吧伙计们,我已经准备好放弃这件事了,我想我差点就在那里,只是最后一个错误,服务器启动很好,但后来却说TCP / IP上的绑定失败了已经在使用的端口:S哪个不正确,因为mysql没有运行:(

错误:

bash-4.2$ mysqld
120730 18:31:05 [Note] Plugin 'FEDERATED' is disabled.
120730 18:31:05 InnoDB: The InnoDB memory heap is disabled
120730 18:31:05 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120730 18:31:05 InnoDB: Compressed tables use zlib 1.2.5
120730 18:31:05 InnoDB: Using Linux native AIO
120730 18:31:05 InnoDB: Initializing buffer pool, size = 128.0M
120730 18:31:05 InnoDB: Completed initialization of buffer pool
120730 18:31:06 InnoDB: highest supported file format is Barracuda.
120730 18:31:06  InnoDB: Waiting for the background threads to start
120730 18:31:07 InnoDB: 1.1.8 started; log sequence number 2929794
120730 18:31:07 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
120730 18:31:07 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
120730 18:31:07 [Note] Server socket created on IP: '0.0.0.0'.
120730 18:31:07 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
120730 18:31:07 [ERROR] Do you already have another mysqld server running on port: 3306 ?
120730 18:31:07 [ERROR] Aborting

120730 18:31:07  InnoDB: Starting shutdown...
120730 18:31:08  InnoDB: Shutdown completed; log sequence number 2929794
120730 18:31:08 [Note] mysqld: Shutdown complete

1 个答案:

答案 0 :(得分:8)

使用lsof -i TCP:3306netstat -lp | grep 3306查找已在端口3306上侦听的内容 - 必须正在侦听它。

您可以考虑在不同的端口上启动服务器(编辑my.cnf并更改默认端口)。

您可能需要以root用户身份运行,即sudo lsof -i TCP:3306