problem with mysql socket

Problems with the Linux version of XAMPP, questions, comments, and anything related.

problem with mysql socket

Postby Touny » 19. October 2006 15:18


I have problem with my mySQL databaze (installed via LAMPP) ... some other program (whitch i allready uninstaled) maked some problems on it.

When i am trying to connect do database (PHP) - mySQL return:

,,Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2)"

Can anyone help me ?

Thanks a lot.
Posts: 1
Joined: 19. October 2006 15:10

Postby Andy_1982 » 11. December 2006 11:47

i try to help you to solve your problem ... i hope it isn't too late!!
If you want to connect to a mysql database, it looks like this:(it is written in c!)

mysql_real_connect(*database, user, password, database name, port, socket, flags)

this is the way you connect ...

user, password datebase name and port is clear i hope ... and now you have just to put "/opt/lampp/var/mysql/mysql.sock" for the socket ... and then it works ...

in a c-code it can looks like this:

mysql_real_connect(mysql, "localhost", "user", "password", "database_new", 3306, "/opt/lampp/var/mysql/mysql.sock", 0)

so i hope this is right and i was able to help you! bye
Posts: 1
Joined: 11. December 2006 11:33

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 22 guests