[imp] can't connect to mysql

andrew morgan morgan@orst.edu
Wed, 4 Apr 2001 08:13:34 -0700 (PDT)


On Wed, 4 Apr 2001, Paul Juliano wrote:

> Hello,
>
> I have a simple question when using the prefs through mysql.  It seems
> that php is trying to connect to /tmp/mysql.sock, but it's not in the
> /tmp directory. It's in /var/lib/mysql/mysql.sock.  I can connect
> throught mysql through the command line just fine, but imp and my
> custom php functions cannot.  What could be wrong?

This usually happens because php is linked to a different set of mysql
libraries than your mysql server.  Since php comes with built-in mysql
support now, that is probably what happened to you.

In imp/config/defaults.php3, you probably have:

$default->db_server_name = 'localhost';

or maybe just:

$default->db_server_name = '';

(which defaults to localhost, I believe).

Try changing this to:

$default->db_server_name = 'localhost:/var/lib/mysql/mysql.sock';


	Andy