session variables on mysql aren't working anymore

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
noguru
Forum Commoner
Posts: 61
Joined: Thu Jun 06, 2002 4:03 am
Location: Just north of the City Of Gold, Land of Milk and Honey

session variables on mysql aren't working anymore

Post by noguru »

Hi

Mysql was working 100%, until my supervisor had brought mysql down (?) and started it up again. Then we started getting the following error on one of our php pages:

Warning: open(/tmp/sess_ba3ef519c60cc3451823e83068912d08, O_RDWR) failed: m (13) in /usr/local/apache/htdocs/apps/php/session.inc.php on line 11

It's got something to do with session variables, because the session_destroy() function wasn't working either. While my supervisor was trying to solve the problem by "killing processes", I now find that session_register() is not working either.

How can we get everything back to normal again?
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Maybe because your MySQL session class has got the wrong details, e.g. wrong table name.
Last edited by Takuma on Thu Sep 05, 2002 3:29 am, edited 1 time in total.
User avatar
noguru
Forum Commoner
Posts: 61
Joined: Thu Jun 06, 2002 4:03 am
Location: Just north of the City Of Gold, Land of Milk and Honey

Post by noguru »

No, the error occurs all over, even on our existing websites that make use of session variables. It's definetely got something to do with sessions.

We also get the following error:

Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (146) in /usr/local/apache/htdocs/mysql_info/mysqlinfo.php on line 35

I need to know the unix commands to set everything back to normal again.
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Are you sure that is the correct folder for the socket.
User avatar
noguru
Forum Commoner
Posts: 61
Joined: Thu Jun 06, 2002 4:03 am
Location: Just north of the City Of Gold, Land of Milk and Honey

Post by noguru »

That is in fact another problem. Apparently the tmp folder gets flushed from time to time and then mysql has to be reset somehow, I'm not too sure about this procedure, I'm just the web programmer :wink:

Everything regarding mysql has been working fine for the past 3 months, but now for some reason we get all these errors. I don't know too much about sever administration, but I don't think these guys know a lot about mysql installation and administration either 8O

I think it might be best to reinstall mysql properly. Is there something in the manual that explains how to do this?
User avatar
gite_ashish
Forum Contributor
Posts: 118
Joined: Sat Aug 31, 2002 11:38 am
Location: India

Post by gite_ashish »

hi,

see mysql man for installation:

http://www.mysql.com/documentation/mysq ... Installing
User avatar
gite_ashish
Forum Contributor
Posts: 118
Joined: Sat Aug 31, 2002 11:38 am
Location: India

Post by gite_ashish »

hi,
That is in fact another problem. Apparently the tmp folder gets flushed from time to time
if you are running on red hat linux see this file (not sure on what all other os it is available):
/etc/cron.daily/tmpwatch
It is a standard package, used for routine clean up. It is pre configured to run from daily crontab.

man tmpwatch
tmpwatch recursively removes files which haven't been accessed for a given number of hours. Normally, it's used to clean up directories which are used for temporary hold­ing space such as /tmp.
it is possible that someone might have changed it to run quite frequently.

i don't know how much it might be helpful to you, but should not be a problem giving in some try.... :!: :?: :!: :idea:
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Warning: open(/tmp/sess_ba3ef519c60cc3451823e83068912d08, O_RDWR) failed:
seems to be the same problem.
sessions are stored (by default) in files. where those files are stored is controlled by session.save_path in php.ini.
If your /tmp-directory get's flushed to often the session files are removed as well :-S

perhaps you should change both (mysql.socket and session-path).

php.ini: session.save_path = /tmp.
my.cnf: socket = /tmp/mysqld.sock
change it to another directory but take care, that the processes can access the files

you have to change mysql.default_socket in php.ini accordingly
Post Reply