Home arrow Administration arrow jtablesession::Store Failed - DB function failed with error number 1062
joomla_commpow_sm.png JoomlaTips.org is not affiliated with or endorsed by the Joomla! Project or Open Source Matters. The Joomla! logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
 
jtablesession::Store Failed - DB function failed with error number 1062 PDF Print E-mail
User Rating: / 0
PoorBest 


It is an error wich drive me crazy couple of times. It's easy to fix - but hard to detect why happening. I didn't see any good explanation which fits to each single situation I needed to handle it.

Before to tell you about the fix: stay cool, probably your site isn't hacked and the database it is in place... else you will get another, nastier error Tongue out

So what's the direct cause? For whatewer reason your 'jos_session' table is damaged. Since this table holds only volatile info about your user's sessions - and nothing recent, since they are seeing the same error, just like you - it is safe to apply one of following recipes:

a. the lancet (I mean the elegant solution)

Go to phpMyadmin in your hosting panel (should be there, it's a must have tool for a LAMP site), select your database, select the 'jos_session' table (or the one with the right prefix for your site) by clicking on the checkbox in the front of the table name, go to the bottom of the table, and click the arrow on the drop-down box which says "With selected:" and then click on "repair table". This will repair the jos_session table and more importantly repair your Joomla site. You will no longer see: "jtablesession::store failed DB function failed with error number 1062".

b. the big hammer (smash it!)

You don't necessarly need for this phpMyadmin, it's good any known method to run queries against your database (for command-line gurus for example MySQL command line interface also will do the job. 

Drop the 'jos_session' table, and re-cereate it! How? Use this SQL query for example:

DROP TABLE `jos_session`;
CREATE TABLE `jos_session` (
`username` varchar(150) default '',
`time` varchar(14) default '',
`session_id` varchar(200) NOT NULL default '0',
`guest` tinyint(4) default '1',
`userid` int(11) default '0',
`usertype` varchar(50) default '',
`gid` tinyint(3) unsigned NOT NULL default '0',
`client_id` tinyint(3) unsigned NOT NULL default '0',
`data` longtext,
PRIMARY KEY  (`session_id`(64)),
KEY `whosonline` (`guest`,`usertype`),
KEY `userid` (`userid`),
KEY `time` (`time`)
) TYPE=MyISAM CHARACTER SET `utf8`; 

Less elegant, but does the same job. Ahh, don't forget to backup everything first, and use the correct Joomla table prefix you have set when you installed the site! If you forgot it, you will easily find this from the configuration.php in this line:

            var $dbprefix = 'jos_';


Add this page to your favorite Social Bookmarking websites
Reddit! Del.icio.us! Mixx! Free and Open Source Software News Google! Live! Facebook! StumbleUpon! Yahoo! Joomla Free PHP
plugin by VivoCiti.com
 
Next >
<img src="http://pixel.quantserve.com/pixel/p-7f15GeXeJo0iE.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast" />