Bug #71829 [Nab]: PHP not able to connect to mySQL database
| From: | jfha73 at gmail dot com | Date: | Fri, 18 Mar 2016 17:22:34 +0000 |
| Subject: | Bug #71829 [Nab]: PHP not able to connect to mySQL database | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-199923@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
User updated by: jfha73 at gmail dot com
Reported by: jfha73 at gmail dot com
Summary: PHP not able to connect to mySQL database
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:
More info:
I just created a script to test socket access to /tmp/mysql.sock and it tested successfully, so if
PHP can open a socket file in the place where it's supposed to be, why can't it open it
using mysqli_connect("localhost", "user", "password",
"database");
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2016-03-17 15:14:04] requinix@php.net
This isn't really the best place for general help. Try a mailing list or online forum.
http://php.net/support.php
------------------------------------------------------------------------
[2016-03-17 15:11:50] jfha73 at gmail dot com
This is weird, if I run:
php mysqltest.php
it works, but if I do it via web it says it cannot find the file, any ideas?
------------------------------------------------------------------------
[2016-03-16 15:09:12] jfha73 at gmail dot com
I just re-configured my mysql to create the mysql.sock at /tmp/mysql.sock and edited php.ini to read
mysql.default_socket where the mysql.sock is and it still won't connect using name (localhost),
I can see the newly created mysql.sock file in /tmp, but PHP 7.0.4 seems not to be able to locate
it, any other ideas?
Thanks.
------------------------------------------------------------------------
[2016-03-15 17:15:54] requinix@php.net
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.
------------------------------------------------------------------------
[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.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=71829
--
Edit this bug report at https://bugs.php.net/bug.php?id=71829&edit=1