If this is your first visit, check our documentation. To post, register or login.
Forums / Installing Zen Cart / Installing on a Linux/Unix Server / database pre-fix, can I change it?

database pre-fix, can I change it?

Locked

Started by audradh on 3 Jul 2006, 7:12 AM · Views: 1,579

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
3 Jul 2006, 7:12 AM
#1
audradh avatar

audradh

Zen Follower

Join Date:
Oct 2005
Location:
Eastern US
Posts:
429
Plugin Contributions:
0

Post #1 by audradh

I did a fresh install of v1.3.0.2 specifying the database prefix as "zen". My tables now show as "zentablename". I wanted them to read "zen_tablename". I'm guessing that during the install I should have used a prefix of "zen_". Is there a way that I can change the prefixes now?

Any advice is much appreciated,
Audra

3 Jul 2006, 9:00 AM
#2
marw avatar

marw

New Zenner

Join Date:
Feb 2006
Location:
Hungary
Posts:
39
Plugin Contributions:
0

Post #2 by marw

Hi!

Yes, you can, but it'll take some time.

You have to rename every table in the database:
ALTER TABLE zentablename RENAME zen_tablename ;

Then you have to change the prefix settings in your config files:
Change this define('DB_PREFIX', 'zen');
to define('DB_PREFIX', 'zen_'); in both includes/configure.php and admin/includes/configure.php.

It should work, but if it's a new install and you haven't changed many things yet, it seeems easier to reinstall the whole thing.

3 Jul 2006, 12:49 PM
#3
audradh avatar

audradh

Zen Follower

Join Date:
Oct 2005
Location:
Eastern US
Posts:
429
Plugin Contributions:
0

Post #3 by audradh

Thank you! I will reinstall w/ the correct prefix:yes:

4 Jul 2006, 5:39 AM
#4
drbyte avatar

drbyte

Sensei

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

Post #4 by drbyte

MarW is right ; however, you can also use the zc_install program via the Database-Upgrade page to change the prefix (but a re-install is definitely better if you have no specific data to preserve !!! )

.
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.