Page 1 of 1

turncate sessions_table via CRON JOB

Posted: Sun Oct 15, 2006 9:09 pm
by Alex Zuyev
Hallo.
Will anyone help me to make a line for a cron job so sessions_table will turncate automatically? I shall set it in my cPanel. Thanx a lot!

Now I have only

Code: Select all

mysqlcheck --repair --analyze --optimize --phpbb --table-phpbb_sessions --auto-repair --user=*** --password=***
and it is not solving the problem.

Posted: Sun Oct 15, 2006 9:48 pm
by espicom
If you have the table set to type "myisam" instead of type "heap", you don't have to worry about the table size... The code you've posted only does a repair on the table, which heap tables don't support anyway.

To trunctate it, you need to send the following SQL statements to the database:

Code: Select all

use mydatabase;
truncate table phpbb_sessions;
You would, of course, substitute your database and table name information for "mydatabase" and "phpbb_sessions". Or the PHP script found in Script to clear/alter sessions table would work, too.