Article ID: 6595, created on Dec 13, 2013, last review on Aug 12, 2014

  • Applies to:
  • Plesk for Linux/Unix

问题

在登录页面上 Parallels Plesk Panel 8.x 中出现以下错误:https://plesk.host.name:8443:

ERROR:PleskMainDBException
MySQL query failed:Incorrect information in file:'./psa/misc.frm'

0:/usr/local/psa/admin/plib/common_func.php3:216
        db_query(string 'select param, val from misc')
1:/usr/local/psa/admin/plib/common_func.php3:513
        get_param(string 'mysql41_compatible')
2:/usr/local/psa/admin/plib/common_func.php3:410
        db_set_names()
3:/usr/local/psa/admin/plib/common_func.php3:389
        db_connect_real(string 'localhost', string 'admin', string '***********', string 'psa')
4:/usr/local/psa/admin/plib/common_func.php3:369
        db_connect()
5:/usr/local/psa/admin/auto_prepend/auth.php3:87


对于 Parallels Plesk Panel 10.x:

ERROR:Zend_Db_Statement_Exception   
SQLSTATE[HY000]:General error:1 Can't create/write to file '/tmp/#sql_39f_0.MYI' (Errcode:13)

0:Pdo.php:234
    Zend_Db_Statement_Pdo->_execute(array)
1:Statement.php:300
    Zend_Db_Statement->execute(array)
2:Abstract.php:479
    Zend_Db_Adapter_Abstract->query(string 'DESCRIBE `ServiceNodes`', array)
3:Abstract.php:238
    Zend_Db_Adapter_Pdo_Abstract->query(string 'DESCRIBE `ServiceNodes`')
4:Mysql.php:169
    Zend_Db_Adapter_Pdo_Mysql->describeTable(string 'ServiceNodes', NULL null)
5:Abstract.php:835
    Zend_Db_Table_Abstract->_setupMetadata()
6:Abstract.php:874
    Zend_Db_Table_Abstract->_setupPrimaryKey()
7:Abstract.php:982
    Zend_Db_Table_Abstract->info()
8:Select.php:100
    Zend_Db_Table_Select->setTable(object of type Db_Table_Broker_ServiceNodes)
9:Select.php:78
    Zend_Db_Table_Select->__construct(object of type Db_Table_Broker_ServiceNodes)
10:Abstract.php:1018
    Zend_Db_Table_Abstract->select()
11:Abstract.php:1331
    Zend_Db_Table_Abstract->fetchAll(string '`transport` = 'local'')
12:Abstract.php:110
    Db_Table_Abstract->findByField(string 'transport', string 'local')
13:Abstract.php:122
    Db_Table_Abstract->findOneByField(string 'transport', string 'local')
14:ServiceNodes.php:226
    Db_Table_Broker_ServiceNodes->getLocalServiceNode()
15: auth.php3:505


引起该问题的原因是什么?

原因

该问题由目录 /tmp 中的不正确的权限引起的。因此,在启动时 MySQL 无法正确创建临时文件用于 InnoDB 引擎。

以下是正确的权限设置:

~# ls -ld /tmp/
drwxrwxrwt 4 root root 36864 Aug  8 08:41 /tmp/
~#

解决方案

请使用以下命令更正权限:

~# chmod 1777 /tmp


其它信息

要查看错误,请使用以下行更新 /etc/my.cnf 文件中的 [mysqld] 部分:

/etc/my.cnf
--->8---
[mysqld]
innodb_force_recovery = 4
---8<---


并通过以下重启服务

~# /etc/init.d/mysqld restart
停止 MySQL:                                            [  OK  ]
Starting MySQL:                                            [  OK  ]
~#

以下错误应在 MySQL 错误日志文件中显示:

/var/log/mysqld.log
--->8---
^G/usr/libexec/mysqld:Can't create/write to file '/tmp/ib1suXEE' (Errcode:13)
020326 22:26:17  InnoDB:Error: unable to create temporary file; errno:13
020326 22:26:18 [Note] /usr/libexec/mysqld: ready for connections.
---8<---


在配置文件中设置 MySQL 错误日志文件的地址:

~# grep log-error /etc/my.cnf
log-error=/var/log/mysqld.log
~#

其它信息

还可以查看该文章:[How to] How to fix InnoDB corruption cases for MySQL database

56797cefb1efc9130f7c48a7d1db0f0c a914db3fdc7a53ddcfd1b2db8f5a1b9c 29d1e90fd304f01e6420fbe60f66f838

Email subscription for changes to this article