Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/custcare/dbconn.inc on line 2

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/custcare/dbconn.inc on line 2

Post by neo_in_mat » Tue, 13 Apr 2004 23:06:56


It's really strange. I downloaded the latest 4.0.16 RPM from mysql.com
and installed it to my Fedora system, and did *not* do anything else
(Actually I am completely new to mysql).

I wrote a test php script to test mysql (ftp_connect('localhost',
'root');), but got the following error:

Warning: mysql_connect(): Can't connect to local MySQL server through
socket '/tmp/mysql.sock' (2) in /home/custcare/dbconn.inc on line 2

I ran phpBB2 installation page, got the same error. But it can connect
to mysql using my computer name. Anyone can help???
 
 
 

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/custcare/dbconn.inc on line 2

Post by Joachim Ml » Tue, 13 Apr 2004 23:33:12


[..]

ps aux | grep mysql

If mysqld's not running; start it...!

root@localhost root]# /etc/init.d/mysql start

--
mvh/regards
Joachim Mand

If everything seems under control, you're just not going fast enough.
-Mario Andretti

 
 
 

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/custcare/dbconn.inc on line 2

Post by Garp » Wed, 14 Apr 2004 01:25:49


Yipe! safe_mysqld, please...

Base problem, it's not PHP that's causing the difficulty, MySQL isn't
running a server. Get a command line MySQL client session going first.

Garp
 
 
 

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/custcare/dbconn.inc on line 2

Post by neo_in_mat » Wed, 14 Apr 2004 10:29:36


Okay, Thanks for replies. But I have found out the solution myself. It
seems that the RPM setup package did not create the socket file in
/tmp. I did:

ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

and all is fine now.