WordPress.org

Ready to get started?Download WordPress

Forums

DB tables for new subdomain site fail to get created (60 posts)

  1. zaneselvans
    Member
    Posted 3 years ago #

    It seems to be related in some way to domain mapping unfortunately (at least, I didn't have any trouble setting up additional blogs before I started domain mapping them, and some combination of turning mapping on and off seemed to resolve the issue temporarily last time I ran into the problem) and that doesn't seem like an easy thing to play with in a local install.

    Though searching around it seems like there are a variety of instances in which this problem ($wp_queries not reflecting the appropriate tables) has come up, so I think it's a more general problem, that's probably better solved by providing an explicit query generation function, as suggested in the trac ticket, rather than relying on the global $wp_queries always having the right context when it's defined.

  2. Are you using the free domain mapping plugin?

    There's 3 that I know of, so specifying helps. ;)

  3. zaneselvans
    Member
    Posted 3 years ago #

    Sorry, yes, I'm using the free one, didn't know there were others. It's the one that drops sunrise.php into wp-content and domain_mapping.php into mu-plugins, from here: https://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

  4. Have you upgraded it?

    Plugins dropped into mu-plugins do not send upgrade notices, so you have to do them manually.

    (FWIW, the other mapping plugins install the same way. ;) )

  5. zaneselvans
    Member
    Posted 3 years ago #

    Nope, I hadn't, was one version behind (0.5.3 vs 0.5.4), but upgrading didn't get rid of the issue.

  6. israelwebdev
    Member
    Posted 3 years ago #

    @zaneselvans can you show the wrapper function and usage codes?

  7. Stab in the dark: did you change the db collation recently? Can you check?

  8. blackriver
    Member
    Posted 3 years ago #

    Exactly the same problem here. DB collation seems fine.

  9. @blackriver did you read through the entire thread and try all the other things mentioned?

  10. blackriver
    Member
    Posted 3 years ago #

    Yep, absolutly. From what I understand the solution has not been posted yet, and the patches mentioned above are not for the current WP version.

  11. So to recap:

    - you checked that the db user has ALL permissions
    - you've disabled any and ALL plugins and tried again
    - you've checked the db to verify no new tables are created

    Did it work at one point and is failing now?
    Are you using the domain mapping plugin?

    Also the patches mentioned above would still apply.

  12. blackriver
    Member
    Posted 3 years ago #

    The patches are for wpmu-functions.php which does not exist anymore, I am using 3.1.2. @zaneselvans were you able to come up with a solution for this?

  13. blackriver
    Member
    Posted 3 years ago #

    Currently I am not even using the domain mapping plugin.
    I do receive the notification that the new site was created and there is a new entry in the blogs table, however new prefix tables are not being created.

  14. Look for ms-functions.php.

    Also
    - you checked that the db user has ALL permissions?

    Everyone who has ever had this issues had a slight different cause each time.

    Have you talked to your web host and told them new tables aren't being added to the db? (this is all server-side action. WP just tells it what to do.)

  15. blackriver
    Member
    Posted 3 years ago #

    In this case I am the web host. I am just really curious if zaneselvans got to any resolution with this.

  16. blackriver
    Member
    Posted 3 years ago #

    Here is the patch for the latest ms-functions.php (for WP 3.1.2) that resolved this issue for me:

    @@ -1042,6 +1042,7 @@
      * @return mixed Returns WP_Error object on failure, int $blog_id on success
      */
     function wpmu_create_blog($domain, $path, $title, $user_id, $meta = '', $site_id = 1) {
    +        global $wpdb, $wp_queries;
     	$domain = preg_replace( '/\s+/', '', sanitize_user( $domain, true ) );
    
     	if ( is_subdomain_install() )
    @@ -1064,6 +1065,14 @@
     		return new WP_Error('insert_blog', __('Could not create site.'));
    
     	switch_to_blog($blog_id);
    +
    +         if($wp_queries){
    +            //$pattern = '/' . $wpdb->base_prefix . '(\d+)/';
    +            $pattern = $wpdb->base_prefix;
    +            $prefix = $wpdb->base_prefix . $blog_id . '_';
    +            $wp_queries = str_replace($pattern, $prefix, $wp_queries); //preg_replace($pattern,$prefix, $wp_queries);
    + 	}
    +
     	install_blog($blog_id, $title);
     	wp_install_defaults($user_id);
  17. mrcherry
    Member
    Posted 3 years ago #

    ive located the file and added the code but it hasnt seemed to have any effect, im receiving the confirmation emal but no files are being created

  18. blackriver
    Member
    Posted 3 years ago #

    Are you sure that you added it correctly, it's a diff patch.

  19. mrcherry
    Member
    Posted 3 years ago #

    i opened it up in dreamweaver and added in the lines ???

    what do you mean by diff patch ???

    apologies

  20. azavarin
    Member
    Posted 3 years ago #

    mrcherry, open ms-functions.php and add
    global $wpdb, $wp_queries;
    at the first line of function body
    and

    if($wp_queries){
                $pattern = $wpdb->base_prefix;
                $prefix = $wpdb->base_prefix . $blog_id . '_';
                $wp_queries = str_replace($pattern, $prefix, $wp_queries);
     	}

    between lines
    switch_to_blog($blog_id);
    and
    install_blog($blog_id, $title);

  21. mrcherry
    Member
    Posted 3 years ago #

    THat still hasnt seemed to work, can anyone tell me how to find the database and check the permissions.

    Ive opened up the cpanel and i cannot seem work out which file i am looking for/ or what the correct permission should be ???

  22. mrcherry
    Member
    Posted 3 years ago #

    So i worked out that through the php admin i can identity the database, but which files do i need to check permissions on and what are the correct permissions?

    heeeelp

  23. mrcherry
    Member
    Posted 3 years ago #

    please can anyone list me the tables required in the database so i can see if any are missing ??

    im really stuck any help would be appreciated.

    also im using php myadmin but i dont know how to check the permissions as previously
    stated

    thanks

  24. - you don;t check permissiosn on databssdee files. You need to check the permissions fo the database *user*. they are the one given permissiosn to do things to the database.

    If you do not know how to do that, ask your host.

    the database tables are listed in the codex.
    http://codex.wordpress.org/Database_Description#Multisite_Table_Overview

    And no - you cannot just go add them.

  25. mrcherry
    Member
    Posted 3 years ago #

    thanks ever so much

  26. mrcherry
    Member
    Posted 3 years ago #

    All the tables are present, also when i view the wp_registration_log table it shows me
    that new site are being registered.

    Also the blog dir, is not creating a new folder for the site as per normal

    I've noticed that my domain mapping screen looks odd;
    the first line used to display the original subdomain i.e officialanisa.mrcherry.co.uk
    domain mapping screen image

    i really dont understand why has happened, after it was working so well before.

    thanks for your help andrea i really appreciate it

  27. mrcherry
    Member
    Posted 3 years ago #

    ive also just had all user permissions re-granted by my host ???

  28. ddarby14
    Member
    Posted 3 years ago #

    Dunno if it helps anyone above or anybody looking ahead:

    Same problem as above, when creating a new MU/network site, tables are not created.

    Checked first the network plugins - only 3. Nope.

    Then I beat my head to check db permissions/quotas (even though those are never touched, but it seemed an obvious check) I turned to updates, updating WP3.1 to WP3.1.3, then the WordPress MU Domain Mapping from 0.5.3 to 0.5.4 on the suggestion of this thread. Nope.

    I don't know the cause, but found the problem in a highly unsuspecting place: the newly installed/tested WordPress Simple Survey 2.0.3 plugin (root site-activated, not network-activated). I didn't do any error debugging (bit drained after all that), but did find complaints about that plugin using generic/conflicting function calls.

    I went ahead and removed WordPress MU Domain Mapping and site-activated the WordPress Simple Survey - same problem, so in my case at least, had nothing to do with WordPress MU Domain Mapping.

    You may not have WordPress Simple Survey, but maybe this helps anyone who has another unsuspecting site-activated (non-network) plugin that is lacking with generic function calls.

  29. hrama14
    Member
    Posted 3 years ago #

    I have similar problem. Previously on 2.9.2 and upgraded to current version per instructions and without any problems. Created a new site and only 6 tables were created: wp_xx_terms, wp_xx_term_taxonomy, wp_xx_term_relationships, wp_xx_postmeta, wp_xx_options, and wp_xx_commentmeta. Tried everything that was posted here and had same results.

  30. hrama14
    Member
    Posted 3 years ago #

    Found a Fix to my missing tables problem.. hope this will help others!

    I just recalled a previous problem where my db (MySQL) would not take a date time value:'0000-00-00 00:00:00' since it is in Strict mode. I found a fix from this forum about a year ago (http://wordpress.org/support/topic/mysql-5-stricttraditional-fix-requesting-feedback?replies=4) This fixed my problem ..again!

Topic Closed

This topic has been closed to new replies.

About this Topic