The MU forums have moved to WordPress.org

How to set wp_ prefixes in MU? (7 posts)

  1. hempsworth
    Member
    Posted 17 years ago #

    Hi,

    I would like to set up two installs of MU in the same database, just so that they can share users. How can I change the prefix to wp_example_ for the second install?

    When I make wp-config.php before installing and set the prefix, I just get an error message saying I should go to /wp-admin/install.php, which does not exist.

    And I cannot change the config file after installing because MU cannot install in the first place, "duplicate entries for wp_1_", becuase it already exists in the original install.

    Perhaps a text-box in the install helper which allows you to set the prefix during the installation process would be a good addition?

  2. hempsworth
    Member
    Posted 17 years ago #

    Can anyone offer any information on this issue?

  3. drmike
    Member
    Posted 17 years ago #

    Actually I wouldn't be using the same database for two installs. You're going to run into file quanity issues ever quicker that way.

    Try looking at line #229 of the index-install.php file. That's where the install script defines the prefix to default to wp_

  4. lunabyte
    Member
    Posted 17 years ago #

    "Might be nice" to be able to type in our own prefix during install. Hmmm...

  5. drmike
    Member
    Posted 17 years ago #

    Looks like it was originally setup for that since this is labaled as a default.

    It is an option on regular wordpress...

  6. lunabyte
    Member
    Posted 17 years ago #

    Yeah, but only because you're editing the config file before installing though.

  7. hempsworth
    Member
    Posted 17 years ago #

    Thanks for the info, will give it a try.

    But, I would rather do this, if it is possible. The second installation in a separate database, and then define the table AND the database in wp-settings.php.

    I think it would mean changing this line:

    $wpdb->users		= $table_prefix . 'users';

    and possibly

    $wpdb->usermeta		= $table_prefix . 'usermeta';

    What can I do to define the database, and table?

    What's the "hmmm.." for? Some users would benefit from being able to specify their own database prefix. Unless it has implications for other parts of the system, why not give users the option?

About this Topic

  • Started 17 years ago by hempsworth
  • Latest reply from hempsworth