Page 1 of 1

FAQ: DB function failed with error number 1016

Posted: Tue Nov 01, 2005 8:18 am
by kenmcd

Q. How do I fix a "DB function failed with error number 1016" error?


Example of error:
DB function failed with error number 1016
Can't open file: 'mos_session.MYI'. (errno: 145) SQL=SELECT session_id FROM mos_session WHERE session_id=MD5('c82c53720d94a9ec7256143da29892b5')
SQL = SELECT session_id FROM mos_session WHERE session_id=MD5('c82c53720d94a9ec7256143da29

Joomla default now names this table jos_session.

A. This error is usually due to the session table being damaged. Repair the table.
Repair the table using a free MySQL tool such as phpMyAdmin or MySQL Administrator.

phpMyAdmin
- Login to your phpMyAdmin DB tool
- Select your Joomla DB
- Find the session table (mos_sessions or jos_sessions, or use your DB prefix)
- Check the check box next to the session table
- Select the Repair option from the drop down select list

MySQL Administrator
- Select Catalogs
- Select your Joomla database
- Select the jos_sessions table
- Select Maintenance button (Tables Maintenance)
- Check box Repair Tables
- Click Next
- Click Repair Tables


If repairing the table does not work, you may delete (drop) and recreate the table.
The table does not contain any permanent data so nothing will be lost.

This SQL code will drop the sessions table and recreate it.

Code: Select all

 
DROP TABLE `jos_session`;
CREATE TABLE `jos_session` (
  `username` varchar(50) 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',
  PRIMARY KEY  (`session_id`),
  KEY `whosonline` (`guest`,`usertype`)
) TYPE=MyISAM;


Enter this SQL code into MySQL directly, or by using a MySQL tool such as phpMyAdmin or MySQL Query Browser.
If you are still using tables with the old "mos_" prefix, change "jos_" to "mos_" in the above SQL code.

Re: FAQ: DB function failed with error number 1016

Posted: Wed Feb 15, 2006 5:43 pm
by coldfrost
Thank you so much.
It was all that I needed, phuh :laugh:

Re: FAQ: DB function failed with error number 1016

Posted: Thu Aug 03, 2006 9:28 am
by wessie
Thanks a ton kenmcd !!!!!!!

Does anyone have any idea wot causes this?

Re: FAQ: DB function failed with error number 1016

Posted: Mon Oct 23, 2006 8:56 am
by klemen
This is probably an hosting company problem, but when I connect with Mysql administrator (windows hosting without phpmyadmin):

MySQL Administrator
- Select Catalogs
- Select your Joomla database    ( I DON'T SEE ANYTHING!!!)

So what can be wrong, permissions?....?

thanks

Re: FAQ: DB function failed with error number 1016

Posted: Mon Nov 13, 2006 6:00 am
by ez2ask
kenmcd wrote:

[b]A. This error is usually due to the session table being damaged. Repair the table.

Repair the table using a free MySQL tool such as phpMyAdmin or MySQL Administrator.

phpMyAdmin
- Login to your phpMyAdmin DB tool
- Select your Joomla DB
- Find the session table (mos_sessions or jos_sessions, or use your DB prefix)
- Check the check box next to the session table
- Select the Repair option from the drop down select list



I try to follow the above information to repair three tables in one of my database and got the following errors:

Can't open file: Can't open file: 'jos_sef_sm_menu.ibd' (errno: 1)
Can't open file: 'jos_sef_sm_modules_menu.ibd' (er...
Can't open file: 'jos_sef_sm_settings.ibd' (errno:...

I could not find any reference of ibd files in any discussion. Those three files mark "in use" and I tried several times to repair, but all got the same message above.......

This happened when I try to use SEF Service Map (front end won't work, neither back end)........I just wonder if they are all related to SEF Service Map or Joomla main program.......any one can help?? PLEASE!! Thanks.

Joomla version: 1.0.7
Apache 2.0, php5, mysql 4.1, phpmyadmin 2.6.2

Re: FAQ: DB function failed with error number 1016

Posted: Tue Jan 16, 2007 6:02 am
by chanman
It's the JOOMLA CORE SEF. 

I disabled that and everything works.