Page 1 of 1

MySQL connection error on install.php step #1

Posted: Sat Dec 18, 2004 6:09 am
by cczona
Help, I'm stuck at install.php step #1. The error returned is
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /PATH/TO/cmsms/adodb/drivers/adodb-mysql.inc.php on line 339
Connection failed
The database seems fine. There's no error when using the same settings to connect via PHPMyAdmin instead.

(By the way, this is with version 0.7.3)

MySQL connection error on install.php step #1

Posted: Sat Dec 18, 2004 12:58 pm
by Ted
Hmm... I wonder why it's trying to connect to a unix socket instead of over the network. Are you just using the standard settings (host: localhost / port: 3306)?

MySQL connection error on install.php step #1

Posted: Sat Dec 18, 2004 3:08 pm
by Akrabat
wishy wrote:Hmm... I wonder why it's trying to connect to a unix socket instead of over the network. Are you just using the standard settings (host: localhost / port: 3306)?
MySQL uses sockets when you use "localhost" as the hostname.

From http://dev.mysql.com/doc/mysql/en/Can_n ... erver.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. A Unix socket file is used if you don't specify a hostname or if you specify the special hostname localhost."