Page 1 of 2

DB Function error 1146

Posted: Tue Apr 08, 2008 10:18 pm
by Jules242
Hello,

I need to transfer a functional joomla installation that is here:

http://qotsa.julianc.com

to another server. Because I am transferring to an IP for now, a joomla cloner script wasn't working right. I decided to do it manually, and got the working sql file from cpanel back as well as phpmyadmin afterwards to double check.

Once the joomla files were upload, the config file updated to match the sql info, I started getting this:

http://66.29.20.98/~thefade/

Code: Select all

DB function failed with error number 1146
Table 'thefade_joom13.jos_session' doesn't exist SQL=SELECT session_id FROM jos_session WHERE session_id = '092d5926226c80011d04bf20201fe8e0'
SQL =

SELECT session_id
 FROM jos_session
 WHERE session_id = '092d5926226c80011d04bf20201fe8e0'
Each time I refresh a different WHERE session_id = is shown. If the SQL works fine on the other server, and I've doubled checked, tried a repair, and done it over a few times, what could this be? Thanks for any help :)

Re: DB Function error 1146

Posted: Fri Apr 11, 2008 9:29 pm
by k4lch
check the db user is the same and database is the same.
you can go thru phpmyadmin and empty the session table

Re: DB Function error 1146

Posted: Mon Apr 28, 2008 6:48 pm
by pwdsoft
DB function failed with error number 1146

You have recieved this error because your database is not using jos_ as its prefix , if you let us know what your database prefix is we will change the code to suit your needs or if you are happy to edit code yourself .

Re: DB Function error 1146

Posted: Wed Apr 30, 2008 11:33 am
by xerive
did you fix the error?

If you are having problems with installation we know some people that can help / will install for you.

Re: DB Function error 1146

Posted: Wed Apr 30, 2008 12:14 pm
by Jules242
pwdsoft wrote:DB function failed with error number 1146
You have recieved this error because your database is not using jos_ as its prefix , if you let us know what your database prefix is we will change the code to suit your needs or if you are happy to edit code yourself .
How can I change the prefix?

Re: DB Function error 1146

Posted: Wed Apr 30, 2008 5:17 pm
by pwdsoft
To Change prefix Go to your database and check correct prefix (common starting charcters of tablename). Put that prefix in your configuration file of joomla.

Re: DB Function error 1146

Posted: Thu May 22, 2008 5:53 pm
by lcipir
$mosConfig_dbprefix = 'jos_';

is this the line your talking about in configuration file? If so, I'm having the same issue and my pre-fixes seem to match.

Re: DB Function error 1146

Posted: Thu Jun 05, 2008 7:43 am
by tabatha3m
I had the same error but pertaining to joomlat.bak_bb2_log. Joomlat is my database name and bak_ is the prefix for my tables. It turned out that the "bb2" was the Bad Behavior bot. I went into the settings for this bot and turned off the "verbose" setting and now I no longer see that mess at the top of my site.

Just wanted to let folks know what worked for me. If you can track down what piece is causing that and check the settings, it may be something similar.

Re: DB Function error 1146

Posted: Sat Nov 08, 2008 12:12 pm
by connectivityanywhere
I am having the exact same problem, I checked my prefix in cpanel and it is rockandm_

In my config file it was jos_

I tried changing it and leaving it, adding the jos prefix to my username and that time it did at least tell me can not connect to the db.

I am at the end of my teather... can ANYONE please shed some light.

Ta

Re: DB Function error 1146

Posted: Wed Nov 12, 2008 7:32 am
by tabatha3m
Connectivityanywhere:

Can you paste the text from your error into a reply here? I think it might not be the prefix that's the problem. If you changed it or ensured the prefix was correct and this error is still getting thrown up, then maybe a component, mod or bot is causing the problem. That's what I explained in my post above. What text comes after the prefix in your error? If you can figure out what that is and disable it or change the settings (as in my case, where I turned off the verbose error reporting for the Bad Behavior bot) then your problem might be solved.

Cheers,
T.

Re: DB Function error 1146

Posted: Fri Feb 06, 2009 6:05 am
by akfirsttry
ok i just made a huge mistake by trying to change the prefix for the tables from the admin section and now i am getting the same error.

Code: Select all

jtablesession::store failed
DB function failed with error number 1146
Table 'joomla.computec_session' doesn't exist SQL=INSERT INTO `computec_session` ( `session_id`,`time`,`username`,`gid`,`guest`,`client_id` ) VALUES ( '201a5cfd70ec046807563293d1ed8878','1233899163','','0','1','1' )

what should i do ..can someone help? Not able to open admin as well as the site.

Re: DB Function error 1146

Posted: Wed Feb 11, 2009 10:52 am
by tabatha3m
Why don't you log into the site where you're hosted - you should be able to get to your sql tables from there and fix the prefixes back to whatever they were. If that doesn't fix it then it's beyond me, I'm afraid.

Re: DB Function error 1146

Posted: Wed Feb 11, 2009 2:06 pm
by k4lch
log in to host control panel locate the configuration.php open it look for
this if 1.5 var $dbprefix = ' '; if 1.0
$mosConfig_dbprefix = ' ';

inside the ' ' change to match the prefix of your database then save it.
try to get into site now if prefix is correct then should be able to log in

Re: DB Function error 1146

Posted: Thu Feb 12, 2009 8:38 am
by akfirsttry
thanks that fixed it :)

Re: DB Function error 1146

Posted: Fri Feb 27, 2009 9:19 am
by thedmob
Urgent! We're having problem when we try to access our frontpage from our Joomla Beckend. Kindly help us below is the error we're getting... and when i go to PHPmyadmin i don't see this table jos_content in the Database.
---- Error -----


DB function failed with error number 1146
Table 'sthelen1_sent.jos_content' doesn't exist SQL=SELECT c.*, g.name AS groupname, cc.title as name, s.title AS sect_name, u.name AS editor, f.ordering AS fpordering, v.name AS author FROM jos_content AS c LEFT JOIN jos_categories AS cc ON cc.id = c.catid LEFT JOIN jos_sections AS s ON s.id = cc.section AND s.scope="content" INNER JOIN jos_content_frontpage AS f ON f.content_id = c.id INNER JOIN jos_groups AS g ON g.id = c.access LEFT JOIN jos_users AS u ON u.id = c.checked_out LEFT JOIN jos_users AS v ON v.id = c.created_by WHERE c.state >= 0 ORDER BY fpordering , fpordering LIMIT 0, 20

Re: DB Function error 1146

Posted: Fri Mar 20, 2009 5:53 am
by founder
dear hero,

my dbprefix is properly specified as
var $dbprefix = 'jos_';

and indeed, JSAS has a warning not to change this

but I still get the 1146 error message and the gibberish about
Table 'xxx.jos_session' doesn't exist

indeed, if you look at the list of db tables for this xxx database, you see there are no tables whatsoever -- on the other hand this is exactly the same situation that pertains with another site in a similar stage of development for which I get no such message!

indeed, the second site has been constructed by copying the files from the first site and making a few changes, yet for the first one everything works fine and for the second one I get the 1146 error message

ideas? oh yee who actually know the innards of joomla

Re: DB Function error 1146

Posted: Fri Mar 20, 2009 1:22 pm
by k4lch
did you create or import a database for the second site?

Re: DB Function error 1146

Posted: Sat Mar 21, 2009 8:57 pm
by founder
I created it, then imported the structure only from the previous one

Re: DB Function error 1146

Posted: Sat Mar 21, 2009 9:00 pm
by founder
further thought to throw a monkeywrench (or a spanner, if you prefer) into all this: I have yet another site under development where all I did was create a new db, without importing anything -- in fact that db has no tables in it -- but for that site I have had no problems so far and do not get the 1146 message

Re: DB Function error 1146

Posted: Sat Mar 21, 2009 10:06 pm
by founder
maybe it's not a monkeywrench, or even a spanner . . . a little more looking and it appears that although that third database was created by me (in the name of the site under development), the system (ie, JSAS) is not using it . . . instead it is using a database it itself creates when it installs joomla . . . these default databases are named some version of %mysql% and they do have the tables . . .

I suppose the same is true of my second site, and although I created a database for it and then imported tables into it, this is not being used either

so, to get back to the original issue, perhaps something went wrong when the default database was created for the second site -- and that's why I get the 1146 message

Re: DB Function error 1146

Posted: Fri Mar 27, 2009 12:27 pm
by munts
I am having the same issue. When I go into the MyPHPAdmin I do not even see a table called Session. Should I manually create one?

Re: DB Function error 1146

Posted: Sun Mar 29, 2009 4:49 am
by founder
I think, now, the best way to deal with the 1146 message is just to start over

delete/uninstall what you have created and then recreate/reinstall what you want

when the new one comes up be sure to rename the configuration file so its name is:
configuration.php . . . otherwise you will get an error message

Re: DB Function error 1146

Posted: Sun Mar 29, 2009 3:48 pm
by munts
Thanks. However, I have a live site right now. If I do this what effect will this have on my site? If we are talking about a temporary downtime, then I am ok, but if I have to rebuild, then need to think about it more.

Re: DB Function error 1146

Posted: Mon Mar 30, 2009 5:49 am
by founder
my experience is with localhost, so you will have to decide for yourself about what to do with a live site

I have discovered one thing about JSAS which is key here (and everywhere): when you Create A New Site, you get a popup which tells you you have to delete the installation folder when you are done

Don't believe it

Don't believe it, not because it is wrong, but because it is ambiguous (and ambiguity is a bedfellow of JSAS).

Do not delete the installation file right after it has been created! In fact, you have to access your site through localhost first -- so that you will be led through a series of screens which create username/password that you will later need to access your site's backend (ie, accessing yoursite/administrator with a username and password)

only after all that do you delete the installation folder

should you delete it before this you will never be able to login successfully to
yoursite/administrator

Re: DB Function error 1146

Posted: Wed Apr 29, 2009 4:44 pm
by erikw493
I had a similar 1146 error when installing AlfContact component. The problem for me was that the Joomla installer had not created the necessary tables in MySQL. I unzipped the AlfContact package and found the SQL install script, then opened in notepad and changed relative table names to absolute in 4 places. I then copied and pasted into phpmyadmin and ran without issues. Component works great now.

So before getting frustrated, be sure to check to make sure the table being requested actually exists in your DB. If it doesn't you may be able to fix easily in a similar way. I hope this helps someone else!

Re: DB Function error 1146

Posted: Tue Aug 04, 2009 9:41 am
by GNETZedd
While Changing from CB support to JomSocial support on a messenger based module I started to receive this error... Any advice would be appreciated...

DB function failed with error number 1146
Table 'gnrmgr_jo151.jos_community_connection' doesn't exist SQL=SELECT DISTINCT c.avatar, m.connect_from , s.username , s.session_id, u.name FROM jos_community_connection m, jos_community_users c, jos_session s, jos_users u WHERE m.connect_to = '70' AND u.id = s.userid and m.connect_from = s.userid and c.userid = s.useridDB function failed with error number 1146
Table 'gnrmgr_jo151.jos_community_users' doesn't exist SQL=SELECT avatar FROM jos_community_users WHERE userid = 70

Re: DB Function error 1146

Posted: Thu Oct 01, 2009 7:02 pm
by katandmouse
I get this EVERY TIME I try to install Joomla manually now on many different servers. The only way I've been able to figure out how to get around the problem is to use Fantastico if it is available and have it install it. Problem is, not all my clients have Fantastico available to them. I've had to go so far as to move their sites to get around the problem.

Can the Joomla folks please fix this? I see lots of people struggling with it.

Re: DB Function error 1146

Posted: Mon Oct 05, 2009 5:43 am
by luis23045
There should be a good tutorial available or a video tutorial for this. We do all of our transfers manually and all of them are like a breeze. Of course at the beginning we were challenged because we were using different database prefixes. One time when we installed a website with a different prefix that we called soley instead of jos_, it cause problems in when trying to export, because we were trying to install it with jos_ database prefix instead of a soley database prefix. Be always sure you change the prefix database.

We always use linux server. They are more easier to use.

Re: DB Function error 1146

Posted: Thu Dec 17, 2009 10:31 pm
by chopnaldo
While Changing from CB support to JomSocial support on a messenger based module I started to receive this error... Any advice would be appreciated...
I had the exact same thing while moving from cb to jomsocial somebody know more about this issue? I'm a bit of a newbie so you gys got help me out step by step

jtablesession::Store Failed
DB function failed with error number 1146
Table 'DB452082.jos_users_visitsession' doesn't exist SQL=INSERT INTO `jos_users_visitsession` ( `session_id`,`time`,`username`,`gid`,`guest`,`client_id` ) VALUES ( 'lm3jqcki2m3pd2b7punfpmhg63','1261088982','','0','1','0' )

So what can i do now in my phpmyadmin which table exactly do i have to edit??

Re: DB Function error 1146

Posted: Wed Mar 03, 2010 11:39 pm
by JJL
I have the same issue, I am getting the 1146 error message, however I tried to change in the configuration.php file the var $dbprefix = 'jos_ '; but I received the following error message "Cannot save configuration.php.", Can you kindly help me with this error message?