MySQL Database

ID #220

I can't connect to local MySQL server through socket 'mysql.sock'

Applies to: Grid System

You are trying to connect to "localhost" which is a web or shell server, not a database server.

Please see this other FAQ for your correct database hostname.

If you need detailed database connection instructions, please see this other FAQ.


Last update: 2010-10-03 16:30
Author: FAQ Admin
Revision: 1.2

Digg it! Share on Facebook Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 2 (2 Votes)

completely useless 1 2 3 4 5 most valuable

You can comment this FAQ

Comment of Anonymous:
From the manual
(http://dev.mysql.com/doc/mysql/en/Can_not_connect_to_server.html):
"A MySQL client on Unix can connect to the mysqld server in two different
ways: By using a Unix socket file to connect through a file in the
filesystem (default ´/tmp/mysql.sock'), or by using TCP/IP, which connects
through a port number. A Unix socket file connection is faster than TCP/IP,
but can be used only when connecting to a server on the same computer."

Therefore, do not make up a DSN like:

mysql://USER:PASS@unix+HOST/DBNAME

it has to be

mysql://USER:PASS@HOST/DBNAME

Added at: 2004-10-17 00:07