View Full Version : Help! securing /tmp & /var/tmp broke mysql
IIIBradIII 12-02-2004, 10:23 PM Our host :angry: (unnamed to protect their reputation) secured our /tmp & /var/tmp for us but broke mysql in the process.
Now, I have no idea what method they used to secure these dirs but nothing can connect to mysql.sock now. Here's the error:
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/tmp/mysql.sock'
eth00 12-02-2004, 10:31 PM They need to create and link the sock file. They are going to have to go back in as root and fix it, without root you can do nothing. I sure hope they are able to secure some stuff better and not break it...
IIIBradIII 12-02-2004, 10:36 PM Well I'm root as well, and I've attempted to recreate the mysql.sock symlink - I'm just not having any success with it.
from /tmp, I tried ln -s /var/lib/mysql.sock
Should that not have done the trick?
Steven 12-02-2004, 10:44 PM check the permissions of /tmp it should be 1777
LP-Trel 12-02-2004, 10:51 PM cd /
chmod 1777 tmp
cd /var
chmod 1777 tmp
/scripts/restartsrv_mysql
/scripts/restartsrv_mysql --check
That should set you straight.
IIIBradIII 12-02-2004, 11:02 PM Thanks for the help guys. I followed your steps exactly Zach, but no change. :(
eth00 12-02-2004, 11:32 PM What does
service mysql start
show ?
IIIBradIII 12-02-2004, 11:47 PM That's the weird part, mysql is running. So of course that shows nothing.
LP-Trel 12-02-2004, 11:53 PM Okay.. lets do this. :D
cd /tmp
rm -f mysql.sock
cd /
chmod 1777 tmp
cd /var/tmp
rm -f mysql.sock
cd /var
chmod 1777 tmp
/scripts/restartsrv_mysql
/scripts/restartsrv_mysql --check
Try that. ;)
eth00 12-02-2004, 11:53 PM Look at the process name and/or the my.cnf to see where the sock file is stored. It is probably storing it as something wierd and the file is not linked to the generic sock file.
IIIBradIII 12-03-2004, 12:03 AM Thanks again Zach, but still nothing after trying those steps. :(
eth00, it's at /var/lib/mysql/mysql.sock
I appreciate the assistance guys - I'll keep trying as long as you have ideas for me. I'm so upset at our host right now I could spit bullets I think - and to think this is what they call Gold Managed Services!
If it will help I can post the steps the host's tech used to secure tmp & var/tmp - I have them logged (just in case something like this happened).
eth00 12-03-2004, 12:10 AM It won't help to paste them, they probably nuked /tmp but forgot save the files...
ln -s /var/lib/mysql/mysql.sock /var/tmp/mysql.sock
LP-Trel 12-03-2004, 12:15 AM Argg... Linux gets me again. :bawling:
Steven 12-03-2004, 12:16 AM Originally posted by eth00
It won't help to paste them, they probably nuked /tmp but forgot save the files...
ln -s /var/lib/mysql/mysql.sock /var/tmp/mysql.sock
actually i prefer
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
ln -s /tmp/mysql.sock /var/tmp/mysql.sock
eth00 12-03-2004, 12:18 AM Originally posted by LP-Trel
Argg... Linux gets me again. :bawling:
You and your bsd ;)
IIIBradIII 12-03-2004, 12:42 AM Originally posted by thelinuxguy
actually i prefer
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
ln -s /tmp/mysql.sock /var/tmp/mysql.sock
Awesome - that did it. I suspected it was symlink-related but I couldn't quite get it right when I tried.
Btw, when I tried your 2nd line it came back with 'ln: `/var/tmp/mysql.sock': File exists' . I assume that's because the first line did the right thing?
Thanks to all of you guys! I appreciate your time!
Steven 12-03-2004, 12:45 AM Originally posted by IIIBradIII
Awesome - that did it. I suspected it was symlink-related but I couldn't quite get it right when I tried.
Btw, when I tried your 2nd line it came back with 'ln: `/var/tmp/mysql.sock': File exists' . I assume that's because the first line did the right thing?
Thanks to all of you guys! I appreciate your time!
Yeah you can ignore the second line. Glad to see it works :)
ReBoot 12-03-2004, 02:35 AM when I reboot the server the mysql.sock file is distroy and get the coennection error ..
Please help with this issue
|