mysql安装端口3306报错,在端口3306上运行的另一个mysqld服务器错误

I have installed Mysql 5.1 on Mac OS X 10.7 Lion. For some reason, though, when I try starting the server with the command "mysqld" I get an error in the log file which says:

120328 21:32:40 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use

120328 21:32:40 [ERROR] Do you already have another mysqld server running on port: 3306 ?

120328 21:32:40 [ERROR] Aborting

If I run "netstat -nat | grep 3306" in my terminal, I get the following:

tcp4 0 0 *.3306 . LISTEN

UPDATE:

So here's the output for that.

mysqld 24645 sb1752 12u IPv4 0xffffff8010f6bde0 0t0 TCP *:mysql (LISTEN)

This is odd though! Because my mysql server is not started.

When I type "mysql" in command line, it says

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

I did install other version of mysql and uninstalled earlier today. Any idea what to do here?

解决方案

You could use netstat -lp | grep 3306 to find out what program is already listening on port 3306 (you should see PID/Program name in last column) and stop that (maybe mysql is already running?).

Alternatively you could start the newly installed server on a different port. (edit my.cnf and change the default port there)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值