Support

Admin Tools

#10141 Error after changing table prefix via Admin tool_urgent

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by nicholas on Thursday, 08 December 2011 11:35 CST

user35537
Using the latest Admin Tools, J 1.5.25.
After changing the table prefix my page and admin access dissappear and I get this error:

Table 'db345366557.jos_session' doesn't exist SQL=INSERT INTO `jos_session`

How to fix that and what is the cause?

nicholas
Akeeba Staff
Manager
First open your database with phpMyAdmin or whichever MySQL administration tool your host provides. Note down the common name of all tables, up to the underscore. For example, if your tables are named like abcd_users, abcd_session and so on, note down abcd_.

Edit your configuration.php file with a text editor. Find the line mentioning $prefix. It should read something like
var $prefix = 'jos_';
Change jos_ with the prefix you recorded above, e.g.
var $prefix = 'abcd_';
if you noted down abcd_ above.

This should do the trick.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user35537
I did that before the post. All prefixes in myAdminphp are changed via Admin tools to abcd_. And the configuration.php var $dbprefix was already changed to abcd_.
But I found that in mysql.php was the old jos_, I changed that also to abcd_ but the problem persist.
Browser cache and cookes are already cleared.

user35537
Issue is solved. There was another configuration.php in a hidden folder (security precautions) I wasn't aware of.

nicholas
Akeeba Staff
Manager
Hold it! It sounds like you have modified your Joomla! core files. The Joomla! core code does not have the database table prefix hard-coded anywhere! It uses the meta-prefix #__ everywhere. This is replaced by the current database prefix on-the-fly. If this doesn't happen on your site it means one of the following:
- You or one of your extensions have modified your core Joomla! files in a stupid way which hard-codes the jos_ prefix
- You are using a badly written extensions which forces the use of the jos_ database table prefix
I am sorry, but I can not offer any support in those cases. The condition for using any of my software is to not have hacked the core Joomla! files. When you do, it's no longer Joomla! and I can't know how my software will behave on this modified environment. It's like using jet fuel in a car instead of a plane.

I would recommend renaming all tables manually so that they use the jos_ prefix and, of course, edit your configuration.php file to reference jos_ again.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

nicholas
Akeeba Staff
Manager
OK, now that makes more sense. But I am stilled puzzled why you had jos_ hardcoded in your mysql.php file. This shouldn't happen :s

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user35537
I have no idea and I did never open/edit the mysql.php file before. I found the hint to check the mysql.php file in the in a Joomla forum. So I assume that this is not a seldom or unknown issue..?

In line 62 I have now (after changing jos_ to abcd_) this entry:

$prefix = array_key_exists('prefix', $options) ? $options['prefix'] : 'abcd_';

I cannot believe that I'm the only one..?

nicholas
Akeeba Staff
Manager
OK, that's a little different than what you were saying in your previous message :) This line checks if your configuration.php file has a dbprefix set up and if it's missing it defaults to jos_. It doesn't have the prefix hardcoded, it's a safe fallback value which is not used under normal circumstances. Therefore, changing it doesn't make any difference at all.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user35537
O.k. thanks for enlighting me:-)

nicholas
Akeeba Staff
Manager
You're welcome!

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!