{"0":"SQLSTATE[HY000] [2002] No such file or directory","1":"#1 Zend_Db_Adapter_Pdo_Mysql->_connect() called at [vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:410]\n#2 Magento\Framework\DB\Adapter\Pdo\Mysql->_connect() called at ......

What does this error means, it keeps reporting the same again and again. How do i solve this

  • make sure is MySQL running? and check the database details are correct in env.php? Commented Mar 10, 2020 at 17:45
  • Please restart mysql and apache sever Commented Mar 10, 2020 at 18:10
  • Thanks for the reply. i did restart, but after few days it will get same kinda error. There is bunch of similar errors, Some says about theme, some about extensions used etc.
    – Winson
    Commented Mar 11, 2020 at 10:21
  • Hi, @BilalUsean MySQL is running i guess, If i feel my website lags then there in var/report folder is on hot. Keep producing same kinda error with some numbers modified. here are some other different logs {"0":"Sorry, something went wrong. You can find out more in the error log.","1":"#1 , and {"0":"SQLSTATE[HY000] [2006] MySQL server has gone away","1":"#1 Zend_Db_Adapter_Pdo_Mysql->_connect() called at..... At finally it will end up with "There has been an error processing your request" And it will get back to normal i guess. {Also read my below reply} please.
    – Winson
    Commented Mar 11, 2020 at 11:14

1 Answer 1


This issue is due to your MySQL server has stopped so you can restart using the below command. Or you can take help of your server team or this issue may be occur due to db corrupt.so please check it also

To restart, start or stop MySQL server from the command line, type the following at the shell prompt…

On Linux start/stop/restart from the command line:

/etc/init.d/mysqld start
 /etc/init.d/mysqld stop
 /etc/init.d/mysqld restart

Some Linux flavors offer the service command too

service mysqld start
 service mysqld stop
 service mysqld restart


 service mysql start
 service mysql stop
 service mysql restart

On macOS Sierra & OSX to start/stop/restart MySQL post 5.7 from the command line:

sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist

On OS X to start/stop/restart MySQL pre 5.7 from the command line:

sudo /usr/local/mysql/support-files/mysql.server start
    sudo /usr/local/mysql/support-files/mysql.server stop
    sudo /usr/local/mysql/support-files/mysql.server restart

Please accept it if this solution work, Thanks

  • yeah i did this about 2 times, past 3 weeks. it keeps reporting the same logs. Some times the site will go offline by displaying error message "There has been an error processing your request". and it will get back to normal after few mins. Is it something related to ram or any other bottle necking related issue?..Because at this time Ram usage shows 108 (Varies up to 1058) MB free out of 3951.
    – Winson
    Commented Mar 11, 2020 at 10:38
  • please make sure that the database is not corrupt. if it's not then it's related to server.you should take help of them or should try to debug that is your code running some big process or not. Commented Mar 11, 2020 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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