如何解决“查询期间丢失与MySQL服务器的连接”?

时间:2015-08-13 14:19:58

标签: php mysql full-text-search silverstripe

我有一个Silverstripe网站已连接到MySql上托管的Rackspace服务器版本5.6.17

我正在努力解决2个不时发生同步的错误,但我无法弄清楚根本原因是什么。

Error: Couldn't run query: COMMIT; Lost connection to MySQL server during query
At line 598 in /home/dployio/deployments/production/1733814/framework/model/MySQLDatabase.php
SS_CustomLogErrorEmailFormatter->format(Array) 
Custom_SS_LogEmailWriter.php:43
Custom_SS_LogEmailWriter->_write(Array) 
Abstract.php:85
Zend_Log_Writer_Abstract->write(Array) 
Log.php:428
Zend_Log->log(Array,3,) 
Log.php:178
SS_Log::log(Array,3) 
Debug.php:301
Debug::fatalHandler(256,Couldn't run query: COMMIT; Lost connection to MySQL server during query,/home/dployio/deployments/production/1733814/framework/model/MySQLDatabase.php,598,Array) 
Debug.php:553
errorHandler(256,Couldn't run query: COMMIT; Lost connection to MySQL server during query,/home/dployio/deployments/production/1733814/framework/model/MySQLDatabase.php,598) 
MySQLDatabase.php:598
MySQLDatabase->databaseError(Couldn't run query: COMMIT; Lost connection to MySQL server during query,256) 
MySQLDatabase.php:150
MySQLDatabase->query(COMMIT;,256) 
DB.php:208
DB::query(COMMIT;) 
SapphireTransactionManager.php:69
SapphireTransactionManager->commit() 
SapphireTransactionManager.php:99
SapphireTransactionManager->transaction(Closure$NewsRequestManager::postNews;280716067) 

然后

Error: Couldn't run query: INSERT INTO "News_Tags" ("NewsID","TagID") VALUES (91, 1225) Table './os_production/News_Tags' is marked as crashed and should be repaired
At line 598 in /home/dployio/deployments/production/1733814/framework/model/MySQLDatabase.php
SS_CustomLogErrorEmailFormatter->format(Array) 
Custom_SS_LogEmailWriter.php:43
Custom_SS_LogEmailWriter->_write(Array) 
Abstract.php:85
Zend_Log_Writer_Abstract->write(Array) 
Log.php:428
Zend_Log->log(Array,3,) 
Log.php:178
SS_Log::log(Array,3) 
Debug.php:301
Debug::fatalHandler(256,Couldn't run query: INSERT INTO "News_Tags" ("NewsID","TagID") VALUES (91, 1225) Table './os_production/News_Tags' is marked as crashed and should be repaired,/home/dployio/deployments/production/1733814/framework/model/MySQLDatabase.php,598,Array) 
Debug.php:553
errorHandler(256,Couldn't run query: INSERT INTO "News_Tags" ("NewsID","TagID") VALUES (91, 1225) Table './os_production/News_Tags' is marked as crashed and should be repaired,/home/dployio/deployments/production/1733814/framework/model/MySQLDatabase.php,598) 
MySQLDatabase.php:598
MySQLDatabase->databaseError(Couldn't run query: INSERT INTO "News_Tags" ("NewsID","TagID") VALUES (91, 1225) Table './os_production/News_Tags' is marked as crashed and should be repaired,256) 
MySQLDatabase.php:150
MySQLDatabase->query(INSERT INTO "News_Tags" ("NewsID","TagID") VALUES (91, 1225),256) 
DB.php:208
DB::query(INSERT INTO "News_Tags" ("NewsID","TagID") VALUES (91, 1225)) 
UnitOfWork.php:415
UnitOfWork->commit() 
SapphireTransactionManager.php:62

在包含不超过100条记录的表(News)上插入记录时发生第一个错误。此表包含几个字段的全文索引(mediumtext键入所有字段)。

第二次查询它试图插入相关的新闻标签

这里的大问题是,一旦发生这种情况,需要重新生成与此相关的全文索引,以使该模块再次工作。这意味着,一旦发生这对错误,就会永久性地破坏。

这是全文索引定义

FULLTEXT INDEX Headline_SummaryHtmlFree_BodyHtmlFree 
(Headline, SummaryHtmlFree, BodyHtmlFree);

我尝试过的事情(显然没有帮助)

  • 修复News_Tags表,因为它涉及崩溃状态<​​/ li>
  • 玩包装尺寸,因为有些地方提到这是一个潜在的原因
  • 询问Rackspace服务器错误日志,发现没有相关内容
  • 在mysql控制台上运行无法从PHP执行的查询,成功所以也许在客户端可以更改某些内容

正如我之前提到的,解决此问题的方法是重新创建全文索引Headline_SummaryHtmlFree_BodyHtmlFree,但我不明白为什么。

0 个答案:

没有答案