5

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

Jacob Krieg
  • 2,834
  • 15
  • 68
  • 140
  • You may first make sure that mysql server is started as this required file is a socket. – hornetbzz Apr 26 '12 at 00:18
  • 2
    as recommendation: dont use xampp on linux, its ok for windows because setting everything up from hand is horrible but on linux its just a performance loss. just install php5, php5-mysql, apache2 and mysql-server and ur done. if you use xampp you wont get any updates and ur server is vulnerable, if you install it from the repos ur mostly not vulnerable. – K1773R Apr 26 '12 at 07:38
  • Thank you for your response. I saw other posts on the internet regarding this issue and no solution. I'm afraid you're right – Jacob Krieg Apr 26 '12 at 11:34
  • K1773R Could not agree more.. Nothing but problems with xampp on linux. Setup is much easier without xampp on linux. Ubuntu 16.10 here. – kiwicomb123 Dec 17 '17 at 11:54
  • i went for xampp because i kept having problems with my own installations of php and mysql. i am still battling this issue of missing socket file and im on macos – Screwtape007 Jun 07 '20 at 00:17

3 Answers3

13

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

Pedro
  • 166
  • 1
  • 5
2

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)

Baz
  • 36,440
  • 11
  • 68
  • 94
Branchito
  • 29
  • 2
2

in ubuntu

/opt/lampp/var/mysql/mysql.sock