FAQ: DB function failed with error number 1016

Moderator: mcsmom

Post Reply
User avatar
kenmcd
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 126
Joined: Thu Aug 18, 2005 2:09 am
Location: California
Contact:

FAQ: DB function failed with error number 1016

Post by kenmcd » Tue Nov 01, 2005 8:18 am


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.
Last edited by kenmcd on Fri Jan 27, 2006 12:06 am, edited 1 time in total.

“How do you know I’m mad?” said Alice.
“You must be,” said the Cat, “or you wouldn’t have come here.”

coldfrost

Re: FAQ: DB function failed with error number 1016

Post by coldfrost » Wed Feb 15, 2006 5:43 pm

Thank you so much.
It was all that I needed, phuh :laugh:

wessie

Re: FAQ: DB function failed with error number 1016

Post by wessie » Thu Aug 03, 2006 9:28 am

Thanks a ton kenmcd !!!!!!!

Does anyone have any idea wot causes this?

klemen

Re: FAQ: DB function failed with error number 1016

Post by klemen » Mon Oct 23, 2006 8:56 am

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

User avatar
ez2ask
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Nov 18, 2005 6:37 pm

Re: FAQ: DB function failed with error number 1016

Post by ez2ask » Mon Nov 13, 2006 6:00 am

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
Last edited by ez2ask on Mon Nov 20, 2006 11:10 pm, edited 1 time in total.

chanman
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sat Oct 07, 2006 8:18 pm

Re: FAQ: DB function failed with error number 1016

Post by chanman » Tue Jan 16, 2007 6:02 am

It's the JOOMLA CORE SEF. 

I disabled that and everything works.


Post Reply