WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Multisite installation failure on replicated mysql (2 posts)

  1. rpickett
    Member
    Posted 1 year ago #

    I download the latest wordpress, setup as normal and follow the instructions here for multisite:

    http://codex.wordpress.org/Create_A_Network

    I get the "error establishing database connection" and all searches (like google wordpress mu "Error establishing a database connection") have the silliest advice "make sure your db user has permissions to create tables". REALLY? Think about it. It was that db user THAT CREATED THE WORDPRESS INSTALL TABLES TO BEGIN WITH.

    But just for fun I put in the root user and pwd to double-check (I own the box). Same results.

    I try the repair database route and get the same results as this guy, a lot of wp_2.... tables are missing:

    http://wordpress.org/support/topic/database-repair-10

    Which gets me to thinking... "2". I have this mysql install setup for replication and this server happens to have auto_increment_offset set to 2.

    I go edit the following tables and change site id to 1 in all of them (they are all 2):

    wp_blogs, wp_site, wp_sitemeta

    presto, it works.

    Bottom line, once again wordpress engineers don't think about any standard database practices and just assume that a PRIMARY key on auto-increment will be "the next number". So they think the default site ID must be 1.

    This is right up there next to their other poor db habits like not having unique indexes on their tables. Hard to keep replicated databases from drifting without unique keys.

  2. rpickett
    Member
    Posted 1 year ago #

    I'm marking this one as resolved, since I give the resolution in the first post.

    But someone at WPHQ should think about changing their multisite numbering logic.

    I'm hoping I don't have this issue with every single site I add to this install...

Topic Closed

This topic has been closed to new replies.

About this Topic