从 CENTOS 5.9 x86_64 上的 WHM,我尝试将 MySQL 5.1 升级到 5.5。 升级失败,MySQL 不再启动。错误:
Beginning MySQL upgrade...
Running: /usr/local/cpanel/scripts/check_cpanel_rpms --targets=MySQL50,MySQL51,MySQL55 --fix
[20130325.101333]
[20130325.101333] Problems were detected with cPanel-provided files which are RPM controlled.
[20130325.101333] If you did not make these changes intentionally, you can correct them by running:
[20130325.101333]
[20130325.101333] > /usr/local/cpanel/scripts/check_cpanel_rpms --fix
[20130325.101333] The following RPMs are missing from your system:
[20130325.101333] MySQL55-server.5.5.30-1.cp1136
[20130325.101334] Removing 0 broken rpms:
[20130325.101334] rpm: no packages given for erase
[20130325.101335] Downloading http://httpupdate.cpanel.net/RPM/11.36/centos/5/x86_64/rpm.md5
[20130325.101336] MySQL55-server-5.5.30-1.cp1136.x86_64.rpm already downloaded
[20130325.101336] Hooks system enabled
[20130325.101336] Checking for and running RPM::Versions 'pre' hooks for any RPMs about to be installed
[20130325.101336] All required 'pre' hooks have been run
[20130325.101336] No RPMS need to be uninstalled
[20130325.101336] Installing new rpms: MySQL55-server-5.5.30-1.cp1136.x86_64.rpm
[20130325.101336] Preparing packages for installation...
[20130325.101337] You have more than one PID file:
[20130325.101337] -rw-rw---- 1 mysql mysql 5 Aug 10 2011 /var/lib/mysql/cpanel-x64.pid
[20130325.101337] -rw-rw---- 1 mysql mysql 5 Jan 8 17:32 /var/lib/mysql/serverpv.pid
[20130325.101337] Please check which one (if any) corresponds to a running server
[20130325.101337] and delete all others before repeating the MySQL upgrade.
[20130325.101337] error: %pre(MySQL55-server-5.5.30-1.cp1136.x86_64) scriptlet failed, exit status 1
[20130325.101337] error: install: %pre scriptlet failed (2), skipping MySQL55-server-5.5.30-1.cp1136
[20130325.101337] W Error Code: 1
[20130325.101337] E The following possible errors were detected while installing RPMs:
[20130325.101337] E %pre(MySQL55-server-5.5.30-1.cp1136.x86_64) scriptlet failed, exit status 1 install
[20130325.101337] The Administrator will be notified to review this output when this script completes
[20130325.101337] Checking for and running RPM::Versions 'post' hooks for any RPMs just installed
[20130325.101337] All required 'post' hooks have been run
MySQL upgrade completed successfully
请指教该怎么做。我没有找到任何要杀死的 MySQL 进程,并且在/var/lib 中看不到 mysql 文件夹...在 ssh ls -al 中“没有这样的文件夹”。
请帮忙:)谢谢。
最佳答案
对我来说,问题的关键在于以下几行:
[20130325.101337] You have more than one PID file:
[20130325.101337] -rw-rw---- 1 mysql mysql 5 Aug 10 2011 /var/lib/mysql/cpanel-x64.pid
[20130325.101337] -rw-rw---- 1 mysql mysql 5 Jan 8 17:32 /var/lib/mysql/serverpv.pid
我对这些pid
文件执行了cat
(cat/var/lib/mysql/xxx.pid
),但它们不对应任何正在运行的进程 (ps ax
)。所以我删除了它们(rm/var/lib/mysql/xxx.pid
)并再次启动 MySQL 升级过程,一切正常。 (如果 EasyApache 仍然无法正常工作,可能还需要再次运行它。)
关于MySQL 5.1升级到5.5报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15617063/