Forum

Thread tagged as: Question

Customizing PERCH_DB_PREFIX

I'm attempting to setup a site with a different DB table name prefix, but I'm unclear as to how to do this.

When I setup the site using the Perch setup, the tables always end up with the prefix "perch3_". I've tried adding a config.php file in place before running setup, but it's overwritten (and thus ignored).

How does one work around this?

Darryl Hein

Darryl Hein 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Interesting question. If you give it the wrong database password, it should write the file and then stop. At which point you can fix the password and the prefix and tell it to try again.

So I would have to rename all the tables manually after they've been created?

Drew McLellan

Drew McLellan 2638 points
Perch Support

No. If you give the wrong password the tables can't possibly be created until you've updated the config file, at which point it'll have your new prefix.

Hmmm, this doesn't seem to work. With an empty database (no tables), I created an empty config file, went to setup, entered the right db info but wrong password and gave me the error (as expected) SQLSTATE[HY000] [1045] Access denied for user 'user'@'localhost' (using password: YES) but the config file has not been updated (still empty).

If I understand your setup process, it seems you only create the config file at the end (I think after the user account is created)?

Drew McLellan

Drew McLellan 2638 points
Perch Support

In which case that must have changed with Perch 3. Is this Perch or Runway?