帮助理解MySQL进程
我不是MySQL专家,已经很晚了,我的眼睛已经昏花了。现在,解决了这个问题...这台服务器上出了点问题,我想知道是否可能是因为它有两个版本的 MySQL,而旧版本(应该处于休眠状态)不知何故复活了。
我不确定我是否正确地读取了这个输出(如下)...有两个 mysql 条目...但我不能确定它们都是正常健康 MySQL 的一部分安装。
usr/local/mysql/bin/mysqld
是新版本,应该正在运行...
但是 ./bin/mysqld_safe
是什么?我不记得在安装新版本之前运行过这个过程......尽管可能是错误的。
旧的(工厂安装的)版本位于 /usr/bin
中,我想确保它没有运行......
$ ps -e | grep mysql
50870 ttys003 0:00.08 /bin/sh ./bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/server.mydomain.com.pid
50979 ttys003 0:00.39 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --log-error=/usr/local/mysql/data/server.mydomain.com.err --pid-file=/usr/local/mysql/data/server.mydomain.com.pid --socket=/var/mysql/mysql.sock --port=3306
I'm not a MySQL expert, it's late and my eyes are batty. Now, with that out of the way... Something's going screwy on this server and I'm wondering if maybe it's the fact that there are two versions of MySQL on it and the old one (which is supposed to be dormant) is somehow coming back to life.
I'm not sure I'm reading this output (below) correctly... There are two mysql entries...but I can't be certain they're both part of a normal healthy MySQL installation.
usr/local/mysql/bin/mysqld
is the new version and should be running...
but what is ./bin/mysqld_safe
? I don't recall this process running before we installed the new version...though could be wrong.
The old (factory installed) version is in /usr/bin
and I want to make sure it's not running...
$ ps -e | grep mysql
50870 ttys003 0:00.08 /bin/sh ./bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/server.mydomain.com.pid
50979 ttys003 0:00.39 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --log-error=/usr/local/mysql/data/server.mydomain.com.err --pid-file=/usr/local/mysql/data/server.mydomain.com.pid --socket=/var/mysql/mysql.sock --port=3306
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,这是正常的。在 Unix 上,正在运行的 MySQL 实例将有两个进程,如示例中所列。
mysqld
是服务器二进制文件;mysqld_safe
是mysqld
的启动器脚本(因此它在输出中显示为由/bin/sh
运行)。(
man mysqld_safe
,或http:// /dev.mysql.com/doc/refman/5.5/en/mysqld-safe.html )。No, this is normal. On Unix, a running MySQL instance will have two processes, as listed in your example.
mysqld
is the server binary;mysqld_safe
is a launcher script formysqld
(hence it is shown as being run by/bin/sh
in your output).(
man mysqld_safe
, or http://dev.mysql.com/doc/refman/5.5/en/mysqld-safe.html ).