Fix for incorrect key file for table ‘jos_session’ and DB function failed with error number 1034 for Joomla sites

Fix for incorrect key file for table ‘jos_session’ and DB function failed with error number 1034 for Joomla sites

So this evening we updated our MYSQL server to version 5.1 all the way up from version 4. After having done so all sites were inaccessible with “Internal Server error”

This obviously was causing us lots of problems! but the fix is detailed here.

Some research led me to the mod_security plugin which was apparently causing this problem

We rebuilt apache and ensured that mod_security was deselected and many sites came back without issue. I am still a bit unclear why this plugin should have caused so many problems so if you know please comment below.

On checking a number of other sites it appeared that all Joomla sites were down and listing errors

incorrect key file for table ‘jos_session’ and DB function failed with error number 1034

image

We checked into these databases in phpmyadmin and sure enough 3 tables were corrupt

jos_session, jos_core_acl_aro and jos_components

Here is the fix!

.. an its not pretty!

It appears that there is an issue during the mysql upgrade process that causes a corruption in these tables on all Joomla installs!

Now we have over 60 Joomla sites running, so this is a major one!

The fix basically meant grabbing last nights database backups from the server and restoring these over the top of the existing SQL databases. Once having done this the sites came back up.

We took backups of all the databases before overwriting them as a precaution and we used the import/export function in PHPmyadmin rather than any CPanel wizards.

If you don’t want to overwrite the whole database then you can restore the backed up database into a blank database and then use PHPmyadmin to export only the above tables that are affected.

Once restored use the export function to export the affected tables only – as below

image

Then change to your active database and do the reverse selecting your exported file. This will import the table over the top of the corrupt table on your live database.

image

Do this for all 3 tables and all should be back up and running.

If you want you can actually just remove all the data in the jos_session table as this only contains dynamic information. To do this click the “Empty” tab whilst having your jos_session table selected.

Warning! this will remove all data from this table so ensure you have a backup of your database and that you have the correct table selected!

image

 

Would recommend taking a backup of the database before doing any imports just in case.

 

Did you find this useful? if so please comment below and let others know.

Leave a Reply


*

Untitled Document

Free Software to increase traffic to your site

Steal A Lifetime Subscription To This 'Ninja' Traffic Toolkit For Free!

Worth over $500

Login