Reputation: 6789
How do you specify protocol = TCP in myql_connect()?
Upvotes: 6
Views: 6356
Reputation: 1870
To my understanding mysql_connect()
uses TCP/IP or socket.
Dependable on what address you give it.
This is from PHP Manual
Note: Whenever you specify "localhost" or "localhost:port" as server, the MySQL client library will override this and try to connect to a local socket (named pipe on Windows). If you want to use TCP/IP, use "127.0.0.1" instead of "localhost". If the MySQL client library tries to connect to the wrong local socket, you should set the correct path as in your PHP configuration and leave the server field blank.
http://php.net/manual/en/function.mysql-connect.php
Upvotes: 1
Reputation: 522382
By reading the manual:
Whenever you specify "localhost" or "localhost:port" as server, the MySQL client library will override this and try to connect to a local socket (named pipe on Windows). If you want to use TCP/IP, use "127.0.0.1" instead of "localhost".
Upvotes: 13