XF 1.4 deleted table sessions

surge

Member
Hey, I have a large forums on a small dedicated machine and there is usually like a hundred people on. What happens is, the xf_session table messed up and makes the website crash. Usually to fix this, I empty the table whenever the website goes offline. This time instead of emptying the table, i accidently deleted the table in myphpadmin. Now the website says An unexpected error occurred. Please try again later.
I can make a new table but I don't know what the columns. Does anyone know how I can create a blank xf_session table?
 
If you look through the install code you will actually find the SQL for the create. Ought to be in the install directory just search by the table name until u see the create or create if not exists.

Someone will drop it to you. Probably would have been best to create a ticket. I'd find it but I'm not at a PC. Figured I'd tell u where to look though.
 
This is for 1.4.3:
Code:
CREATE TABLE `xf_session` (
`session_id` varbinary(32) NOT NULL,
`session_data` mediumblob NOT NULL,
`expiry_date` int(10) unsigned NOT NULL,
PRIMARY KEY (`session_id`),
KEY `expiry_date` (`expiry_date`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
 
lol you beat me

$tables['xf_session'] = "
CREATE TABLE xf_session (
session_id VARBINARY(32) NOT NULL,
session_data MEDIUMBLOB NOT NULL,
expiry_date INT UNSIGNED NOT NULL,
PRIMARY KEY (session_id),
KEY expiry_date (expiry_date)
) ENGINE = MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci
";
 
If your websites session table fails daily, it may be time to research mysql optimizations or contact your host -- it shouldn't fail, but definitely not fail that often.
 
Top Bottom