Zen Cart Logo
Forums / Installing on a Linux/Unix Server / database pre-fix, can I change it?

database pre-fix, can I change it?

Locked

Views: 1,567

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

database pre-fix, can I change it?

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

Re: database pre-fix, can I change it?

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

Re: database pre-fix, can I change it?

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,513
Plugin Contributions:
176

Re: database pre-fix, can I change it?

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 !!! )