>>>>> "Ritschie" == Ritschie <krichard@stripped> writes:
Ritschie> Tried using PHP3's mysql_connect() function, while the mysqld is running.
Ritschie> I checked the user and password is OK.
Ritschie> If I am root (I mean the UNIX user) I can connect by typing:
Ritschie> mysql -u webuser -pmypass.
Ritschie> But if I am only a simple user (I mean UNIX user) then I am unable to
Ritschie> I need to connect from PHP3. That is the main problem.
Ritschie> The error I get back when trying to connect with mysql_connect()
Ritschie> Warning: MySQL Connection Failed: Can't connect to local MySQL server
Ritschie> through socket '/var/lib/mysql/mysql.sock' (111) in
Does the above socket exists and what is the privilege for the file ?
If it doesn't exists, your PHP isn't compiled to use the same sockets
than mysqld and you have to recompile it!
You may be able to fix this by setting the MYSQL_UNIX_PORT environment
variable to point to the right socket file (you can find this with
shell> perror 111
grep 111 /usr/include/asm/errno.h
#define ECONNREFUSED 111 /* Connection refused */
I don't know when you get connection refused; It may be a privilege
problem on the above socket.