Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XAMPP mysql.sock is missing

I installed XAMPP from the apachefriends.org following these instructions: http://www.apachefriends.org/en/xampp-linux.html#377 .

The problem is that file /opt/lampp/var/mysql/mysql.sock is missing. How can i get this file? Thing is I want to run an easy MySQL command learning tool and I get this error that the file is missing. (Warning: PDO::__construct() [pdo.--construct]: [2002] No such file or directory (trying to connect via unix:///opt/lampp/var/mysql/mysql.sock) in /opt/lampp/htdocs/SID/sid.php on line 188)

XAMPP is running ok, I started it with sudo /opt/lampp/lampp start. http://localhost/ works fine. I checked /opt/lampp/etc/my.cnf and it's ok, it contains this data http://pastebin.me/8d6b367a7ee76be70f944d9b960bb8f0

Please help, how can I get that mysql.sock?

Thanks

like image 525
Jacob Krieg Avatar asked Dec 01 '22 22:12

Jacob Krieg


2 Answers

execute the next command in a Terminal windows:

ps -ax|grep mysql

And you can see a result like this:

--socket=/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock --port=3306

Bes Regards

PS: I use MAC OS X

like image 159
Pedro Avatar answered Dec 15 '22 15:12

Pedro


I think you are running other instance of mysql..

try this :

/opt/lampp/bin/mysql -u *user* -p

and then enter your password when asked for.. Hope this helps..

I had a similar case, when putting only mysql, because that way it wasnt called lampp stack mysql but /usr/bin/mysql (which you can find typing --> which mysql)

like image 22
Branchito Avatar answered Dec 15 '22 15:12

Branchito