Bug #71829 [Opn->Nab]: PHP not able to connect to mySQL database

From: Date: Tue, 15 Mar 2016 17:15:58 +0000
Subject: Bug #71829 [Opn->Nab]: PHP not able to connect to mySQL database
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199844@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71829&edit=1 ID: 71829 Updated by: requinix@php.net Reported by: jfha73 at gmail dot com Summary: PHP not able to connect to mySQL database -Status: Open +Status: Not a bug Type: Bug Package: MySQLi related Operating System: Linux PHP Version: 7.0.4 Block user comment: N Private report: N New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Specifying "localhost" as the hostname will try to use a socket file. Your MySQL server may not have created one. Previous Comments: ------------------------------------------------------------------------ [2016-03-15 16:42:41] jfha73 at gmail dot com Update to the ticket, it does work when I connect using IP address (127.0.0.1) but when name (localhost) is used, I checked my /etc/hosts and it has 127.0.0.1 set as localhost, also my firewall is disabled. ------------------------------------------------------------------------ [2016-03-15 16:28:58] jfha73 at gmail dot com Description: ------------ All it gets is this: SQLSTATE[HY000] [2002] No such file or directory MySQL can be accessed via console, just not using PHP with phpMyAdmin or a WebApp that uses MySQL. Any idea what I can do about this? Thanks. Test script: --------------- phpMyAdmin Expected result: ---------------- Connect to mySQL database server Actual result: -------------- Error saying No such file or directory. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71829&edit=1

« previous php.bugs (#199844) next »