views:

97

answers:

1

Hay all, i need a little hlep.

I'm trying to connect to my localhost MySQL server via php in the terminal.

It's outputting that it cannot connect to the host through my socket. My PHP ini install says this

MYSQL_SOCKET    /tmp/mysql.sock

so i used

mysql_connect("/tmp/mysql.sock","root","","");

And i get errors

Any suggestions?

+1  A: 

Did you try

mysql_connect(":/tmp/mysql.sock","root","","");

like mentioned in the manual.

BTW: Posting what errors you get might help when asking questions.

Daff
adding ':' worked. Thanks
dotty