Bug #71829 [Com]: PHP not able to connect to mySQL database
| From: | jfha73 at gmail dot com | Date: | Tue, 15 Mar 2016 16:42:42 +0000 |
| Subject: | Bug #71829 [Com]: PHP not able to connect to mySQL database | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-199842@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
Comment by: jfha73 at gmail dot com
Reported by: jfha73 at gmail dot com
Summary: PHP not able to connect to mySQL database
Status: Open
Type: Bug
Package: MySQLi related
Operating System: Linux
PHP Version: 7.0.4
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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