在端口3306上运行的另一个mysqld服务器错误 [英] Another mysqld server running on port 3306 error

查看:264
本文介绍了在端口3306上运行的另一个mysqld服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Mac OS X 10.7 Lion上安装了Mysql 5.1.但是由于某种原因,当我尝试使用"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 [错误]无法启动服务器:在TCP/IP端口上绑定:地址已在使用中

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

120328 21:32:40 [错误]您是否已经在端口3306上运行了另一个mysqld服务器?

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

120328 21:32:40 [ERROR]正在中止

120328 21:32:40 [ERROR] Aborting

如果我在终端中运行"netstat -nat | grep 3306",则会得到以下信息:
tcp4 0 0 * .3306 .

If I run "netstat -nat | grep 3306" in my terminal, I get the following:
tcp4 0 0 *.3306 . LISTEN

更新:

所以这是输出.
mysqld 24645 sb1752 12u IPv4 0xffffff8010f6bde0 0t0 TCP *:mysql(LISTEN)

So here's the output for that.
mysqld 24645 sb1752 12u IPv4 0xffffff8010f6bde0 0t0 TCP *:mysql (LISTEN)

这很奇怪!因为我的mysql服务器没有启动.
当我在命令行中键入"mysql"时,它说
错误2002(HY000):无法通过套接字'/tmp/mysql.sock'(2)连接到本地MySQL服务器

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)

我确实安装了其他版本的mysql,并且今天早些时候已卸载.知道在这里做什么吗?

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

推荐答案

您可以使用netstat -lp | grep 3306找出端口3306上已经在侦听的程序(您应该在最后一栏中看到PID/程序名称)并停止该程序(也许mysql已经在运行?).

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?).

或者,您可以在其他端口上启动新安装的服务器. (编辑my.cnf并在此处更改默认端口)

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

这篇关于在端口3306上运行的另一个mysqld服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆