Mysql

嘗試升級到 PHP 5.3 後無法在 centOS5 上啟動 mysqld

  • October 20, 2011

我嘗試使用從腳本http://www.atomicorp.com/installers/atomic.sh開始將我的系統 PHP 從 PHP 5.2 升級到 5.3 。

然後我用 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

在我看來,這/usr/libexec/mysqld是一個目錄 - 目錄無法執行。它通常是一個文件。

您需要將其替換為舊包中的文件。如果這不起作用,您可能需要重新安裝 MySQL 包。

# chown -R mysql /var/run/mysqld/

然後再試一次。

引用自:https://serverfault.com/questions/323175