MySQL启动报错“Bind on TCP/IP port: Address already in use”

启动报错“Bind on TCP/IP port: Address already in use”

问题描述:
mysql启动失败,查看err日志
# tail -f /database/umc/data/umc.err
141106 10:37:14 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
141106 10:37:14 [ERROR] Do you already have another mysqld server running on port: 3306 ?

原因分析:

端口3306被占用

使用命令:
ps -aux | grep mysql
发现并没有3306端口的mysql进程。

使用命令:netstat –apn 
查看所有的进程和端口使用情况。发现下面的进程列表,其中最后一栏是PID/Program name 
# netstat -apn  | grep 3306    
tcp        0      0 ::ffff:192.168.65.211:3306  ::ffff:192.168.65.211:3306  ESTABLISHED 18148/java 

发现3306端口被PID为18148的Java进程占用。

进一步使用命令:ps -aux | grep java,或者直接:ps -aux | grep pid 查看
就可以明确知道3306端口是被哪个程序占用了!然后判断是否使用KILL命令干掉!
 
#启动mysql

观察

# netstat -anp  | grep 3306 
tcp        0      0 :::3306                     :::*                        LISTEN      16511/mysqld        
tcp        0      0 ::ffff:192.168.65.211:3306  ::ffff:192.168.65.211:4840  ESTABLISHED 16511/mysqld        
tcp        0      0 ::ffff:192.168.65.211:3306  ::ffff:192.168.65.211:4841  ESTABLISHED 16511/mysqld        
tcp        0      0 ::ffff:192.168.65.211:3306  ::ffff:192.168.65.211:4842  ESTABLISHED 16511/mysqld        
tcp        0      0 ::ffff:192.168.65.211:3306  ::ffff:192.168.65.211:4837  ESTABLISHED 16511/mysqld        
tcp        0      0 ::ffff:192.168.65.211:3306  ::ffff:192.168.65.211:4838  ESTABLISHED 16511/mysqld        
tcp        0      0 ::ffff:192.168.65.211:4837  ::ffff:192.168.65.211:3306  ESTABLISHED 17632/java          
tcp        0      0 ::ffff:192.168.65.211:4838  ::ffff:192.168.65.211:3306  ESTABLISHED 17632/java          
tcp        0      0 ::ffff:192.168.65.211:4840  ::ffff:192.168.65.211:3306  ESTABLISHED 17632/java          
tcp        0      0 ::ffff:192.168.65.211:4841  ::ffff:192.168.65.211:3306  ESTABLISHED 17632/java          
tcp        0      0 ::ffff:192.168.65.211:4842  ::ffff:192.168.65.211:3306  ESTABLISHED 17632/java  

 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值