Doctrine\DBAL\Exception\ConnectionException: An exception occured in driver: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

#1 vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php 145: Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', ...)
#2 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php 47: Doctrine\DBAL\DBALException::driverException(Object, ...)
#3 vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php 360: Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, ...)
#4 vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php 429: Doctrine\DBAL\Connection->connect()
#5 vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php 389: Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#6 vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php 328: Doctrine\DBAL\Connection->detectDatabasePlatform()
#7 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php 763: Doctrine\DBAL\Connection->getDatabasePlatform()
#8 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php 632: Doctrine\ORM\Mapping\ClassMetadataFactory->getTargetPlatform()
#9 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php 174: Doctrine\ORM\Mapping\ClassMetadataFactory->completeIdGeneratorMapping(Object)
#10 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php 332: Doctrine\ORM\Mapping\ClassMetadataFactory->doLoadMetadata(Object, ...)
#11 vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php 78: Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->loadMetadata('Course')
#12 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php 216: Doctrine\ORM\Mapping\ClassMetadataFactory->loadMetadata('Course')
#13 vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php 281: Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor('Course')
#14 vendor/doctrine/orm/lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php 44: Doctrine\ORM\EntityManager->getClassMetadata('Course')
#15 vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php 698: Doctrine\ORM\Repository\DefaultRepositoryFactory->getRepository(Object, ...)
#16 application/Bootstrap.php 403: Doctrine\ORM\EntityManager->getRepository('Course')
#17 vendor/zendframework/zendframework1/library/Zend/Application/Bootstrap/BootstrapAbstract.php 679: Bootstrap->_initMenu()
#18 vendor/zendframework/zendframework1/library/Zend/Application/Bootstrap/BootstrapAbstract.php 632: Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('menu')
#19 vendor/zendframework/zendframework1/library/Zend/Application/Bootstrap/BootstrapAbstract.php 596: Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap(null)
#20 vendor/zendframework/zendframework1/library/Zend/Application.php 355: Zend_Application_Bootstrap_BootstrapAbstract->bootstrap(null)
#21 public/index.php 22: Zend_Application->bootstrap()