I have installed Magento Community Edition on Digitalocean application. I extracted the error report and listed below, can you help take a look and let me know what to do in order to fix?

a:4:{i:0;s:109:"SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)";i:1;s:2884:"#0 /var/www/html/magento/lib/Zend/Db/Adapter/Pdo/Mysql.php(109): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /var/www/html/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php(320): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 /var/www/html/magento/lib/Zend/Db/Adapter/Abstract.php(460): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 /var/www/html/magento/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 /var/www/html/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 /var/www/html/magento/app/code/core/Mage/Core/Model/Resource.php(169): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 /var/www/html/magento/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 /var/www/html/magento/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#8 /var/www/html/magento/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#9 /var/www/html/magento/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#10 /var/www/html/magento/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(360): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#11 /var/www/html/magento/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134): Mage_Core_Model_Resource_Db_Abstract->getReadConnection()
#12 /var/www/html/magento/app/code/core/Mage/Core/Model/Config.php(1348): Mage_Core_Model_Resource_Db_Collection_Abstract->__construct(Object(Mage_Core_Model_Resource_Website))
#13 /var/www/html/magento/app/code/core/Mage/Core/Model/Config.php(1380): Mage_Core_Model_Config->getModelInstance('core_resource/w...', Object(Mage_Core_Model_Resource_Website))
#14 /var/www/html/magento/app/Mage.php(491): Mage_Core_Model_Config->getResourceModelInstance('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#15 /var/www/html/magento/app/code/core/Mage/Core/Model/Abstract.php(208): Mage::getResourceModel('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#16 /var/www/html/magento/app/code/core/Mage/Core/Model/Abstract.php(213): Mage_Core_Model_Abstract->getResourceCollection()
#17 /var/www/html/magento/app/code/core/Mage/Core/Model/App.php(608): Mage_Core_Model_Abstract->getCollection()
#18 /var/www/html/magento/app/code/core/Mage/Core/Model/App.php(466): Mage_Core_Model_App->_initStores()
#19 /var/www/html/magento/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Model_App->_initCurrentStore('', 'store')
#20 /var/www/html/magento/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#21 /var/www/html/magento/index.php(87): Mage::run('', 'store')
#22 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";}
  • To enable exception printing copy errors/local.xml.sample to errors/local.xml. But don't do it for production sites because of the mentioned security reasons. – clockworkgeek Oct 18 '14 at 11:13
  • Hi - yes, so i follow some other posts suggestion to extract the error report from ftp client. Any clue for me to fix this? – Cheuk Man Ng Oct 19 '14 at 12:08

It looks like MySQL is not running. From the server can you use the MySQL client to connect ?

If not then try starting MySQL. Service mysqld start

Let me know how you get on.

  • Hi James, When I input service mysql start in command line, it works again!!! So what should I do now to fix thhis? thanks!!!!! – Cheuk Man Ng Oct 19 '14 at 12:07
  • I would check the mysql log to try and understand why it shut down. Var/log/mysql – James Cowie Oct 19 '14 at 14:46
  • Hi, I tried to post the error log here, but its too long so I will split it in two separate comments. Please, help me out of this...thanks, appreciated – Cheuk Man Ng Oct 19 '14 at 15:23
  • 141019 11:17:57 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 141019 11:17:57 [Note] Plugin 'FEDERATED' is disabled. 141019 11:17:57 InnoDB: The InnoDB memory heap is disabled 141019 11:17:57 InnoDB: Mutexes and rw_locks use GCC atomic builtins 141019 11:17:57 InnoDB: Compressed tables use zlib 1.2.8 141019 11:17:57 InnoDB: Using Linux native AIO 141019 11:17:57 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 – Cheuk Man Ng Oct 19 '14 at 15:23
  • 141019 11:17:57 InnoDB: Completed initialization of buffer pool 141019 11:17:57 InnoDB: Fatal error: cannot allocate memory for the buffer pool 141019 11:17:57 [ERROR] Plugin 'InnoDB' init function returned error. 141019 11:17:57 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 141019 11:17:57 [ERROR] Unknown/unsupported storage engine: InnoDB 141019 11:17:57 [ERROR] Aborting 141019 11:17:57 [Note] /usr/sbin/mysqld: Shutdown complete – Cheuk Man Ng Oct 19 '14 at 15:24

thats an issue which can often be solved by using instead of localhost

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.