centos 5.4一般故障解决方法

一、关于yum的一些错误解决方法

故障现象:

Another app is currently holding the yum lock; waiting for it to exit...
The other application is: yum-updatesd-he
Memory : 6.7 M RSS ( 57 MB VSZ)
Started: Wed Dec 15 08:06:15 2010 - 1:18:44 ago
State  : Sleeping, pid: 3660

解决方法:

a、rm -rf /var/run/yum.pid
b、/sbin/service yum-updatesd restart

二、关于Mysql的一些安装错误解决方法

1、

a:如果编译时出现了以下错误:
  checking for tgetent in -ltermcap… no
  checking for termcap functions library… configure: error: No curses/termcap  library  found

这下可苦 了我了,继续查找下,

[root@myserver lamp]# yum -y install ncurses*  #装这个就可以解决那个问题
现在就可以重新编译Mysql进行安装。

 

 

如果编译时出现了以下错误:
checking for tgetent in -ltermcap… no
checking for termcap functions library… configure: error: No curses/termcap library found
说明 curses/termcap 库没有安装
去下载一个ncurses-5.6.tar.gz,
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.6.tar.gz
tar zxvf ncurses-5.6.tar.gz
cd ncurses-5.6
./configure –prefix=/usr –with-shared –without-debug
make
make install clean
然后再重新编译Mysql进行安装。

 

今天在linux上安装出现了如下错误:

STOPPING server from pid file /var/run/mysqld/mysqld.pid
051111 10:35:27  mysqld ended


[1]+  Done                    bin/mysqld_safe --user=mysql

 

解决:

1、mkdir /var/run/mysqld 
2、chown -R mysql /var/run/mysqld
3、chgrp -R mysql /var/run/mysqld

 三、 安装php开启mysql出现类似Cannot find libmysqlclient_r under /usr/local/mysql错误

 

在编译PHP5.3.3以上版本,经常会看到如下错误,常常以为是PHP的./configure后边什么参数没有写对,很让人费解
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
configure: error: Cannot find libmysqlclient_r under /usr/local/mysql. Note that the MySQL client library is not bundled anymore!其实这跟PHP没有系
那是因为我在编译APACHE的时候,使用--with-mpm模块,所以就必须在编译MYSQL的时候加上 --enable-thread-safe-client.
这是PHP5.2的一个改进,在PHP5.2.0之前的版本都不需要MYSQL启用安全线程。关于--enable-thread-safe-client项的官方介绍如下:如何生成线程式客户端库总是线程安全的。最大的问题在于从套接字读取的net.c中的子程序并不是中断安全的。或许你可能希望用自己的告警中断对服务器的长时间读取,以此来解决问题。如果为SIGPIPE中断安装了中断处理程序,套接字处理功能应是线程安全的。SupeSite/X-为了避免连接中断时放弃程序,MySQL将在首次调用mysql_server_init()、mysql_init()或mysql_connect()时屏蔽SIGPIPE。如果你打算使用自己的SIGPIPE处理程序,首先应调用mysql_server_init(),然后安装你的处理程序.

还有第二种解决方法比较方便 :编译之前,先处理一下mysql的库,默认查找libmysqlclient_r.so,可是mysql默认为libmysqlclient.so,内容完全一样,做个链接即可
# cd /usr/local/mysql/lib/mysql/
# ln -s libmysqlclient.so.15.0.0 libmysqlclient_r.so