My site was running fine, then out of no where I got this error
A Database Error Occurred Error Number: 145
Table './sitename/default_ci_sessions' is marked as crashed and should be repaired
INSERT INTO `default_ci_sessions`
(`user_data`,
`session_id`,
`ip_address`,
`user_agent`,
`last_activity`)
VALUES ('',
'dad23c3ecc0460e7f37ec8c46c3f5c3f',
'ipaddress',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5)AppleWebKit/537.36 (KHTML, like Gecko)Chrome/29.0.1547.76 Safari/537.36',
1380030504)
Filename: core/Loader.php
Line Number: 998
Not sure what this is or how this can be fix.
Looks like your sessions table is marked as crashed und should be repaired.
Since those are "only" session data rows, you could delete the table and create a new one with the same name and the following design:
CREATE TABLE IF NOT EXISTS `default_ci_sessions` (
session_id varchar(40) DEFAULT '0' NOT NULL,
ip_address varchar(45) DEFAULT '0' NOT NULL,
user_agent varchar(120) NOT NULL,
last_activity int(10) unsigned DEFAULT 0 NOT NULL,
user_data text NOT NULL,
PRIMARY KEY (session_id),
KEY `last_activity_idx` (`last_activity`)
);
Structure is from CodeIgniter Sessions doc, which is also used in PyroCMS.
As to why it crashed: you would need to check the logs (Apache and/or MySQL) or check with your hoster/provider to get more information on this.
You can download the PyroDatabase module that allow you to fix tables.
Here the download: https://github.com/adamfairholm/PyroDatabase