# Database connect error

**URL:** <https://community.open-emr.org/t/database-connect-error/14413>\
**Category:** Management and Administration\
**Created:** [May 5, 2020, 2:41pm UTC](https://community.open-emr.org/t/database-connect-error/14413 "2020-05-05T14:41:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gutiersa](https://community.open-emr.org/user_avatar/community.open-emr.org/gutiersa/32/11958_2.png) [@gutiersa](https://community.open-emr.org/u/gutiersa)\
**Post date:** [May 5, 2020, 2:41pm UTC](https://community.open-emr.org/t/database-connect-error/14413/1 "2020-05-05T14:41:30Z")

</div>

I had openerm running yesterday, but today I am getting this error on the screen:

> **Warning** : mysqli\_real\_connect(): (HY000/2002): No such file or directory in **/usr/local/www/openemr/library/ADODB\_mysqli\_log.php** on line **188**  
> Check that mysqld is running.  
> **Fatal error** : Allowed memory size of 268435456 bytes exhausted at /usr/ports/lang/php74/work/php-7.4.5/Zend/zend\_execute.c:185 (tried to allocate 262176 bytes) in **/usr/local/www/openemr/vendor/adodb/adodb-php/adodb.inc.php** on line **183**

The logs have:

> 2020/05/05 10:33:13 [error] 75956#100518: \*51 FastCGI sent in stderr: "  
> PHP message: PHP Warning: mysqli\_real\_connect(): (HY000/2002): No such file or directory in /path/to/openemr/library/ADODB\_mysqli\_log.php on line 188  
> PHP message: PHP custom error: from openemr library/sql.inc - Unable to set up UTF8 encoding with mysql database: No such file or directory  
> PHP message: Unable to set strict sql setting: No such file or directory  
> PHP message: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted at /usr/ports/lang/php74/work/php-7.4.5/Zend/zend\_execute.c:185 (tried to allocate 262176 bytes) in /path/to/openemr/vendor/adodb/adodb-php/adodb.inc.php on line 183" while reading response header from upstream, client: 192.168.1.1, server: [openemr.mydomain.com](http://openemr.mydomain.com), request: “GET /interface/login/login.php?site=mysite HTTP/2.0”, upstream: “fastcgi://unix:/path/to/php-fpm.sock:”, host: “[openemr.mydomain.com](http://openemr.mydomain.com)”

What is happening?  
I could use some advice. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![gutiersa](https://community.open-emr.org/user_avatar/community.open-emr.org/gutiersa/32/11958_2.png) [@gutiersa](https://community.open-emr.org/u/gutiersa)\
**Post date:** [May 5, 2020, 2:56pm UTC](https://community.open-emr.org/t/database-connect-error/14413/2 "2020-05-05T14:56:03Z")

</div>

Ok, NVM. It turns out all I had to do was restart the MySQL server. For some reason the socket had disappeared from the temporary location where it’s supposed to be. Don’t ask me why.  
Hence, when this happens. A restart of the system may be a good idea if possible.

These error messages mean openemr cannot connect to the database server.
