![尝试升级到 PHP 5.3 后无法在 centOS5 上启动 mysqld](https://linux22.com/image/564879/%E5%B0%9D%E8%AF%95%E5%8D%87%E7%BA%A7%E5%88%B0%20PHP%205.3%20%E5%90%8E%E6%97%A0%E6%B3%95%E5%9C%A8%20centOS5%20%E4%B8%8A%E5%90%AF%E5%8A%A8%20mysqld.png)
我尝试使用从脚本开始将系统 PHP 从 PHP 5.2 升级到 5.3http://www.atomicorp.com/installers/atomic.sh。
然后我使用 yum 来更新它。一切似乎都运行良好,但我无法再次启动 mysql 守护进程,而且网站似乎甚至没有使用新版本的 PHP。
我在 mediatemple 上托管了一个 DV,我真的需要让它运行起来。我的下一步是将容器重置为出厂设置,并尝试复制所有内容。
当我尝试使用启动 mysql 时,/etc/init.d/mysqld restart
错误日志中出现以下内容
111020 20:13:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
nohup: cannot run command `/usr/libexec/mysqld': Permission denied
111020 20:13:57 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
我在 Google 上到处搜索,但没有找到任何与 lib exec 权限被拒绝有关的问题。
使用uname -a
我得到以下我的操作系统信息
Linux leereichardt.co.nz 2.6.9-023stab051.3-enterprise #1 SMP Wed Nov 4 19:28:06 MSK 2009 i686 i686 i386 GNU/Linux
并cat /etc/redhat-release
给我
CentOS release 5.2 (Final)
这是我的 my.cnf 文件
[mysqld]
query-cache-type = 1
query-cache-size = 8M
#basedir=/usr
#set-variable=local-infile
log-error=/var/log/mysqld.log
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
#set-variable = innodb_buffer_pool_size=2M
#set-variable = innodb_additional_mem_pool_size=500K
#set-variable = innodb_log_buffer_size=500K
#set-variable = innodb_thread_concurrency=2
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
#set-variable = innodb_buffer_pool_size=2M
#set-variable = innodb_additional_mem_pool_size=500K
#set-variable = innodb_log_buffer_size=500K
#set-variable = innodb_thread_concurrency=2
输出如下
ls -la /var/lib/mysql
total 28852
drwxr-xr-x 20 mysql mysql 4096 Oct 20 11:59 .
drwxr-xr-x 25 root root 4096 Oct 20 12:12 ..
drwxr-xr-x 2 mysql mysql 12288 Sep 6 20:12 c5_growtheseed
drwxr-xr-x 2 mysql mysql 4096 Jan 20 2011 cueit
drwxr-xr-x 2 mysql mysql 4096 Apr 20 2010 horde
-rwxr-xr-x 1 mysql mysql 5242880 Oct 20 11:59 ib_logfile0
-rwxr-xr-x 1 mysql mysql 5242880 Oct 19 01:59 ib_logfile1
-rwxr-xr-x 1 mysql mysql 18874368 Oct 20 11:59 ibdata1
drwxr-xr-x 2 mysql mysql 4096 Apr 9 2010 ifight
drwxr-xr-x 2 mysql mysql 4096 Apr 19 2011 jkb
drwxr-xr-x 2 mysql mysql 4096 Apr 7 2011 joe_amos
drwxr-xr-x 2 mysql mysql 4096 May 13 19:02 kidontherock
-rwxr-xr-x 1 mysql mysql 2216 Oct 20 11:48 leereichardt.co.nz.err
drwxr-xr-x 2 mysql mysql 4096 Jun 7 20:49 my_wordpress
drwxr-xr-x 2 mysql mysql 4096 Oct 20 12:20 mysql
drwxr-xr-x 2 mysql mysql 20480 Apr 13 2010 pathways_moodle
drwxr-xr-x 2 mysql mysql 24576 Dec 20 2010 pathways_test_moodle
drwxr-xr-x 2 mysql mysql 4096 Apr 9 2010 phpmyadmin_aUPVzrrE9aev
drwxr-xr-x 2 mysql mysql 8192 Apr 9 2010 psa
drwxr-xr-x 2 mysql mysql 4096 Mar 1 2011 rscc_website
drwxr-xr-x 2 mysql mysql 4096 Jul 20 2010 rscc_youth
drwxr-xr-x 2 mysql mysql 4096 Jul 14 15:24 spence
drwxr-xr-x 2 mysql mysql 4096 Sep 29 22:28 victor_wp
drwxr-xr-x 2 mysql mysql 4096 Apr 12 2010 wp_theblower
输出ls -la /var/run/mysqld
total 8
drwxr-xr-x 2 root mysql 4096 Oct 20 16:35 .
drwxr-xr-x 18 root root 4096 Oct 20 13:21 ..
输出ls -ld /tmp
drwxrwxrwt 533 root root 16384 Oct 20 13:21 /tmp
答案1
在我看来,这/usr/libexec/mysqld
是一个目录 - 而目录无法执行。它通常是一个文件。
您需要用旧包中的文件替换此文件。如果这不起作用,您可能需要重新安装 MySQL 包。
答案2
# chown -R mysql /var/run/mysqld/
然后再试一次。