Title: Lost database connection
Last modified: May 29, 2020

---

# Lost database connection

 *  [Purnendu](https://wordpress.org/support/users/impurnendu/)
 * (@impurnendu)
 * [6 years ago](https://wordpress.org/support/topic/lost-database-connection-3/)
 * Here is the error message-
 * Warning: mysqli_real_connect(): (HY000/2002): Can’t connect to local MySQL server
   through socket ‘/var/lib/mysql/mysql.sock’ (2) in /home/****/public_html/wp-includes/
   wp-db.php on line 1626

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Contributor [Maya](https://wordpress.org/support/users/tdgu/)
 * (@tdgu)
 * [6 years ago](https://wordpress.org/support/topic/lost-database-connection-3/#post-12912758)
 * Hi
    Sorry but this is not a code related error, apparently, WordPress can’t connect
   to the database. Check with your hosting support why the database is not available.
 * Thanks
 *  Thread Starter [Purnendu](https://wordpress.org/support/users/impurnendu/)
 * (@impurnendu)
 * [6 years ago](https://wordpress.org/support/topic/lost-database-connection-3/#post-12914414)
 * I already removed the codes from .htaccess and it is now working now. WP_Include
   rewrite is causing the issue
 *  Plugin Contributor [Maya](https://wordpress.org/support/users/tdgu/)
 * (@tdgu)
 * [6 years ago](https://wordpress.org/support/topic/lost-database-connection-3/#post-12914800)
 * Hi,
    This should be caused by something else, most probably a different code 
   which does not like the default URLs changes. Check with the server errors log
   which should reveal more details upon the exact issue.
 * Thanks
 *  Plugin Contributor [Maya](https://wordpress.org/support/users/tdgu/)
 * (@tdgu)
 * [6 years ago](https://wordpress.org/support/topic/lost-database-connection-3/#post-12914812)
 * What server type you are using?

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Lost database connection’ is closed to new replies.

 * ![](https://ps.w.org/wp-hide-security-enhancer/assets/icon-256x256.png?rev=2937681)
 * [WP Hide & Security Enhancer](https://wordpress.org/plugins/wp-hide-security-enhancer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-hide-security-enhancer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-hide-security-enhancer/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-hide-security-enhancer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-hide-security-enhancer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-hide-security-enhancer/reviews/)

## Tags

 * [Database Error](https://wordpress.org/support/topic-tag/database-error/)

 * 4 replies
 * 3 participants
 * Last reply from: [Maya](https://wordpress.org/support/users/tdgu/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/lost-database-connection-3/#post-12914812)
 * Status: not resolved