问题
注意:本文中所描述的问题是由来自 Atomic repository 的 MySQL 更新引起的,因此在执行修复之前请务必启用 Atomic repository:
# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* atomic: www4.atomicorp.com
- 更新后MySQL无法启动。
- 在 Plesk 中会显示以下错误信息:
Error in Plesk:
ERROR: PleskFatalException
Unable to connect to database: mysql_connect() [<a
href='function.mysql-connect'>function.mysql-connect</a>]: No
such file or directory
0: common_func.php3:153
psaerror(string
'Unable to connect to database: mysql_connect() [<a
href='function.mysql-connect'>function.mysql-connect</a>]: No
such file or directory')
1: auth.php3:116
或
ERROR: Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] No such file or directory
Additionally, an exception has occurred while trying to report this error: Zend_Exception
No entry is registered for key 'translate' (Abstract.php:144)
Search for related Knowledge Base articles
ERROR: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]
[2002] No such file or directory' in
/usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php:129
Stack trace: #0
/usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php(129):
PDO->__construct('mysql:dbname=ps...', 'admin', '$AES-128-CBC$Zm...',
Array) #1
/usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Mysql.php(111):
Zend_Db_Adapter_Pdo_Abstract->_connect() #2
/usr/local/psa/admin/externals/Zend/Db/Adapter/Abstract.php(460):
Zend_Db_Adapter_Pdo_Mysql->_connect() #3
/usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php(238):
Zend_Db_Adapter_Abstract->query('select param, v...', Array) #4
/usr/local/psa/admin/plib/Db/Adapter/Pdo/Mysql.php(30):
Zend_Db_Adapter_Pdo_Abstract->query('select param, v...', Array) #5
/usr/local/psa/admin/plib/db.php(36):
Db_Adapter_Pdo_Mysql->query('select param, v...') #6
/usr/local/psa/admin/plib/db.php(212): db_query('select param, v...',
false) #7 /usr/local/psa/admin/plib/Plesk/Mode.php(4 (Abstract.php:144)
- 在 /var/log/mysqld.log 中没有记录。
原因
Atomic 发行了损坏的 mysql 包到其 repositories 中。
在更新过程中 mysql 安装包会被更新,但是却未创建所需的目录 /var/lib/mysql-files。
解决方案
此问题已被 Atomic 通过 5.5.54-1199 版本的 mysql-server 包进行修复。请将包更新到最新版本:
# yum update mysql-server
如果没有标记要更新的包,请清除 yum 缓存:
# yum clean all
# yum update mysql-server