首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >mysql服务器挂在“显示处理列表”上

问mysql服务器挂在“显示处理列表”上
EN

Server Fault用户
提问于 2011-04-22 09:39:29
回答 1查看 992关注 0票数 2

我遇到了一个问题,我的mysql服务器陷入了基本操作永远挂起的状态。

代码语言:javascript
复制
$ mysql -ubuildbot -p -hdbserver
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7406
Server version: 5.5.9-log MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mydb
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show processlist;
[hangs forever]
^C^C^C^C^C^C^C^C^C
[still stuck]

不,它没有用完磁盘空间。CPU使用率很低。

iostat产出:

代码语言:javascript
复制
Linux 2.6.28-11-server (PSDB102)    04/22/2011  _x86_64_    (4 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           3.65    0.01    0.62    0.09    0.00   95.74
EN

回答 1

Server Fault用户

发布于 2011-04-22 11:45:14

我建议您看一下error_log,它可能会给您一些提示。如果error_log没有输出任何有用的信息,那么strace就会伸出援手。

像这样使用它:

代码语言:javascript
复制
strace -f -o strace.output -p pid_of_mysqld_parent

这将跟踪由MySQL服务器进程及其子进程(因此是-f标志)发出的所有系统调用,并将它们输出到名为strace.output的文件中。然后,在运行strace时,连接到MySQL,然后按照上面的步骤执行,直到进程挂起。挂起后,在strace终端上键入CTRL+C并查看文件。这可能会启发你的道路,并给你一些线索,是怎么回事。

这个问题也可能发生在客户端,因此,如果上面的输出没有帮助,那么您可能会想要扼杀客户机:

代码语言:javascript
复制
 strace -f -o strace.output mysql -ubuildbot -p -hdbserver

然后,您只需在strace.output挂起之后再看看它。

希望这能有所帮助!

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/262485

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档