1

I've made a mess on my server. I'm using LAMPP and I've created a new user apache:apache and assigned him to take care of the Apache. phpMyAdmin did not work due to that change so I had to chown the phpmyadmin/config.inc.php to apache:apache. That worked but then I made the most stupidest thing, I chowned the whole /opt/lampp dir to apache:apache. I've installed the LAMPP inside a VM to copy all the file and dir permissions. Now I have the mysql.sock issue. It DOES exist but it won't connect.

raski@xxxxxx:~$ sudo cat /opt/lampp/etc/my.cnf |grep socket

socket = /opt/lampp/var/mysql/mysql.sock

raski@xxxxxx:~$ sudo cat /opt/lampp/etc/php.ini |grep mysql.default_socket

pdo_mysql.default_socket=/opt/lampp/var/mysql/mysql.sock

mysql.default_socket = /opt/lampp/var/mysql/mysql.sock

raski@xxxxxx:~$ ls -ld /opt/lampp/var/mysql/mysql.sock

srwxrwxrwx 1 mysql wheel 0 2011-07-15 12:09 /opt/lampp/var/mysql/mysql.sock

raski@xxxxxx:~$ mysql -u root -p

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (111)

I'd paste 'ls -lR /opt/lampp/var/mysql/' but that would be too much ;) All dbases are set to mysql:mysql which I created. I don't know who was the owner of the files before and which group they belonged to. I googled and saw everywhere mysql:mysql so I created it.

Any suggestions? Thx in advance!

RASKi
  • 11
  • 1

1 Answers1

2

Just rebuild the machine, and treat it as a learning experience in the value of proofreading your command lines before you hit "enter". At least you didn't rm -rf something crucial (like an un-backed up production database).

womble
  • 95,029
  • 29
  • 173
  • 228
  • Agreed. Additionally I'd add that using LAMPP/WAMP/MAMP, or any of the other pre-packaged LAMP installer in production is craziness. They're all made for *development only*, and they make that clear in their documentation. Use your distribution's package management systems to install the requisite software and libraries. – EEAA Jul 15 '11 at 14:45