Forums / Installing on a Linux/Unix Server / Addon Domain - 1146 Table 'database .configuration' doesn't exist

Addon Domain - 1146 Table 'database .configuration' doesn't exist

Views: 2,442

Results 1 to 20 of 20
22 Jan 2012, 10:22 PM
#1
starmands avatar

starmands

New Zenner

Join Date:
Sep 2010
Posts:
29
Plugin Contributions:
0

Addon Domain - 1146 Table 'database .configuration' doesn't exist

Hi I'm using 1.3.9d. I have studied all of the threads on this but my problem is slightly different. I want to create a copy of my primary domain in an addon domain so I have created an addon domain (this is redirected to my primary domain for now) and completed a clean install of 1.3.9d and followed the installation notes. I have now copied my primary domain folders and files over checked and rechecked the modified configuration.php files. I can get into admin ok with the addon domain and everything is there from my primary domain but when I try to go into the site as a user https://www.mywebsite.ca/index.php I get the 1146 table error - 1146 Table 'dbname.configuration' doesn't exist in:
[select configuration_key as cfgkey, configuration_value as cfgvalue from configuration]
Any help would be appreciated.

Thanks

23 Jan 2012, 4:29 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

Instead of copying your existing site first, you should FIRST install a fresh new copy of Zen Cart in the new domain, and get THAT working FIRST.
https://www.zen-cart.com/tutorials/index.php?article=100

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

23 Jan 2012, 12:54 PM
#3
starmands avatar

starmands

New Zenner

Join Date:
Sep 2010
Posts:
29
Plugin Contributions:
0

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

Yes that's what I did. Everything worked before I copied my other site files and database over.

23 Jan 2012, 3:44 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

When you copied the files over, did you mistakenly overwrite the new configure.php files that were built by the fresh install?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

23 Jan 2012, 4:11 PM
#5
starmands avatar

starmands

New Zenner

Join Date:
Sep 2010
Posts:
29
Plugin Contributions:
0

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

No, I renamed both config files before copying the other system over then put the new config files back. When I look at the new config files they seem to have all of the correct information.

23 Jan 2012, 4:14 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

You said the error message is: "Table 'dbname.configuration' doesn't exist"

Does "dbname" match what your DB_DATABASE setting is in your configure.php file?
Does DB_PREFIX match the DB_PREFIX from your previous install? (note step 2(a) in the article I linked to earlier)

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

23 Jan 2012, 4:25 PM
#7
starmands avatar

starmands

New Zenner

Join Date:
Sep 2010
Posts:
29
Plugin Contributions:
0

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

Yes it shows the correct database name. For example my database name from my other site is _zc1 and the new one that I created for the new site is _zc2 and that is what is in the config file. The user name is different in the new config than the old one but when I created the database (_zc2) I set up the new username.

23 Jan 2012, 4:35 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

And the DB_PREFIX?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

23 Jan 2012, 4:41 PM
#9
starmands avatar

starmands

New Zenner

Join Date:
Sep 2010
Posts:
29
Plugin Contributions:
0

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

Yes I set the DB_Prefix the same as the site that I copied over.

23 Jan 2012, 4:43 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

So what is DB_PREFIX set to?

And since Zen Cart uses DB_PREFIX when making its queries, and automatically inserts that prefix before the table name, why is Zen Cart looking for "configuration" instead of "yourprefix_configuration"?
That tells me that the /includes/configure.php file does NOT include your prefix.

Remember, the configure.php files are marked as read-only, and in that state any upload or edit you attempt will fail. Must make it writable before you can save changes to it.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

23 Jan 2012, 4:50 PM
#11
starmands avatar

starmands

New Zenner

Join Date:
Sep 2010
Posts:
29
Plugin Contributions:
0

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

The DB_Prefix is zen_ the same as the other site. When I look at the config file in file manager on my site the zen_ prefix is there. When I changed it I had write authority.

23 Jan 2012, 4:52 PM
#12
starmands avatar

starmands

New Zenner

Join Date:
Sep 2010
Posts:
29
Plugin Contributions:
0

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

The actual errot is as follows:

1146 Table 'mydatabasename_zc_2.configuration' doesn't exist
in:
[select configuration_key as cfgkey, configuration_value as cfgvalue from configuration]

23 Jan 2012, 4:52 PM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

If Zen Cart is seeing the correct configure.php files then the error message would have included the prefix.
Since it doesn't, then that means your configure.php files have the wrong information.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

23 Jan 2012, 4:55 PM
#14
starmands avatar

starmands

New Zenner

Join Date:
Sep 2010
Posts:
29
Plugin Contributions:
0

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

What would be the reason that I can access the site via Admin but not from the web using the url and /index.php? I can make modifications in admin so that must be using the database! Could it be a problem with the PHP file? I used the generic one from the install and also tried the one from the other site.

23 Jan 2012, 5:01 PM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

There are 2 configure.php files. If your admin works fine then that suggests your admin file is fine. But if your storefront does not, then that tells me that your non-admin file is not correct.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

23 Jan 2012, 5:04 PM
#16
starmands avatar

starmands

New Zenner

Join Date:
Sep 2010
Posts:
29
Plugin Contributions:
0

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

This is what the config file in /includes looks like:

// define our database connection
define('DB_TYPE', 'mysql');
define('DB_PREFIX', 'zen_');
define('DB_SERVER', 'localhost');
define('DB_SERVER_USERNAME', 'myusername');
define('DB_SERVER_PASSWORD', 'mypassword');
define('DB_DATABASE', 'database_zc2');
define('USE_PCONNECT', 'false');
define('STORE_SESSIONS', 'db');
// for STORE_SESSIONS, use 'db' for best support, or '' for file-based storage

23 Jan 2012, 5:17 PM
#17
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

And how does that differ from those same settings in your admin file?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

23 Jan 2012, 5:22 PM
#18
starmands avatar

starmands

New Zenner

Join Date:
Sep 2010
Posts:
29
Plugin Contributions:
0

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

Where do I find the config file for admin? Is it the configuration.php in /admin/configuration.php? If so that file looks completly different than the one I pasted from /admin/includes/configuration.php. There doesn't appear to be any settings to change in the /admin/coniguration.php all seem to be variables!

23 Jan 2012, 5:25 PM
#19
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

/admin/includes/configure.php
/includes/configure.php

The files are NEVER COMPLETELY IDENTICAL, but do have many similarities.
But the DB_XXXXXX settings DO NEED TO BE IDENTICAL in both files.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

23 Jan 2012, 5:43 PM
#20
starmands avatar

starmands

New Zenner

Join Date:
Sep 2010
Posts:
29
Plugin Contributions:
0

Re: Addon Domain - 1146 Table 'database .configuration' doesn't exist

OK, I was looking at the wrong config file!! I was looking at the root directory config file instead of the /includes/configuration.php file. The configuration file had the DB_Prefix as ''.

Problem solved. Thank you so much.