I am trying to test a website on a local machine that has Windows 7 installed. I want to use named pipes to connect to the MySQL server, but mysql_connect()
seems to throw an error:
[2002] No connection could be made because the target machine actively (trying to connect via tcp://localhost:3306)
For some reason it's still using TCP. I'm testing with a simple PHP (5.3) script:
<?php
mysql_connect("localhost", "root", "password") or die();
echo "It works!";
?>
The MySQL client works fine. It's just a problem with PHP (note: using TCP instead works).
This is what I have in my.ini:
[client]
pipe
socket=mysql
[mysqld]
skip-networking
enable-named-pipe
socket=mysql
I tried setting these variables in php.ini:
pdo_mysql.default_socket = mysql
mysql.default_socket = mysql
mysqli.default_socket = mysql