July 25th, 2000, 12:46 AM
I am having prblem where every night the /tmp/mysql.socket is deleted. I am not sure how..can't find a crontab that is deleting /tmp dir. But any way read mysql docs on how to fix and they say...
"start safe_mysqld with the --socket=/path/to/socket option and set the environment variable MYSQL_UNIX_PORT to the socket pathname before starting your MySQL clients"
the starting safe_mysqld part i GET.
But WHERE can I find and set the environment variable MYSQL_UNIX_PORT ?????
I do not see a my.conf file any where!
Please help..its a pain in the *** staying up till 2am restarting server every night!
July 30th, 2000, 12:06 AM
What operating system are you using?
Generally in a Unix operating system, you can simply run a startup script (or add lines to an existing startup script) that sets the variable; something like this:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>#/usr/bin/bash
MYSQL_UNIX_PORT = "/path/to/socket"
# then start mysql here
Depending on your shell, the syntax may vary, but you get the idea. you also have to make sure the MYSQL_UNIX_PORT variable is set BEFORE safe_mysqld is executed.
[This message has been edited by rycamor (edited July 29, 2000).]
July 30th, 2000, 06:39 PM
Thanks for the response. I got a similiar response elsewhere and attempted exactly what you suggested. BUT it is REALLY weird!
First I do this
#/usr/bin/bashMYSQL_UNIX_PORT = "/path/to/socket"export MYSQL_UNIX_PORT# then start mysql heresafe_mysqld --socket=/path/to/socket
after mysqld is running I use mysqladmin to find out where the socket is and it reports back /tmp2 (the directory I created for it)
BUT from the browser when trying to insert info or run a query it comes up with the SAME error can not connect to mysql.sock in /tmp/mysql.sock !
It is as though the envronment variable change NEVER took place!
Any ideas on that one?
I am running
mysqld Ver 3.22.27
July 31st, 2000, 12:18 AM
Fortunately, FreeBSD happens to be the OS I am most familiar with. I have spent countless hours with Apache, MySQL, PHP, etc...
I notice you mention a browser, but you don't mention what server-side method you use to connect to MySQL. Is it PHP, Perl, JSP? When you say "It is as though the envronment variable change NEVER took place" it makes me think: maybe you should check the owner of the script, and the username of the server-side scripting language (nobody:nobody?). Environment variables can be different for different users.
Also, I would recommend you get the last stable version of MySQL, which is 3.22.32
July 31st, 2000, 02:31 PM
Thanks again for taking your time out here to help. I am using php3 as a scriptiong language....but I am unsure as how to tell who the owner of that is.
I'll try the upgrade to the latest version oh Mysql and see if that does anything.
August 1st, 2000, 12:49 AM
Generally, the PHP process runs under the username 'nobody', and group 'nobody'.
Try to chown your mysql startup script:
chown nobody:nobody mysql_start_script.sh
However, I really think something isn't quite right here: I have used exactly the same combination of server software on many installs and it has worked perfectly well without worrying about the mysql temp socket. Maybe you have some data corruption occurring on your hard drive, or something.
If I were you, I would start clean: test your hardware, and reinstall FreeBSD, then MySQL, Apache, PHP, etc... While you're at it, may as well install PHP4.
August 1st, 2000, 01:20 AM
Well...as mush as I hate to say it...That seems like the best solution. Might as well upgrade server a littel while I am at it!
Thanks for your help again! And i'll let you know how I make out.
October 27th, 2000, 04:32 PM
If you want to stop this deleting from tmp put sticky bit on /tmp dir with chmod +t /tmp. This will protect your file from beeing deleter from some other than mysql.