WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Multi-site wildcard subdomain sites have error establishing database connection (10 posts)

  1. serialboxhpc
    Member
    Posted 2 years ago #

    I am having an odd issue.

    I created a bunch of subdomains on my site a few days ago on a different server (same setup.. centos/php/mysql/) and then migrated my site to a new server.

    Everything is working, including the subdomains sites I created on the old server. I can view the blogs, write posts, whatever.

    However I am not able to create any NEW subdomain sites successfully. After I create a new subdomain site, and try to visit it, I get a server error, "Error establishing database connection" . When I view the list of sites, the new site IS listed there. If I hover over the 'view' link for the blog, the URL is actually itself (the current admin url) rather than the url to the blog like the other functioning ones.

    The rest of the site works, just hte new one throws this error. If I visit /wp-admin then it tells me to repair the database tables. When I do that, I get this:

    NEWEST_wp_33_posts: Table 'cssinthecloud.NEWEST_wp_33_posts' doesn't exist
    NEWEST_wp_33_comments: Table 'cssinthecloud.NEWEST_wp_33_comments' doesn't exist
    NEWEST_wp_33_links: Table 'cssinthecloud.NEWEST_wp_33_links' doesn't exist
    NEWEST_wp_33_options: Table 'cssinthecloud.NEWEST_wp_33_options' doesn't exist
    NEWEST_wp_33_postmeta: Table 'cssinthecloud.NEWEST_wp_33_postmeta' doesn't exist
    NEWEST_wp_33_terms: Table 'cssinthecloud.NEWEST_wp_33_terms' doesn't exist
    NEWEST_wp_33_term_taxonomy: Table 'cssinthecloud.NEWEST_wp_33_term_taxonomy' doesn't exist
    NEWEST_wp_33_term_relationships: Table 'cssinthecloud.NEWEST_wp_33_term_relationships' doesn't exist
    NEWEST_wp_33_commentmeta: Table 'cssinthecloud.NEWEST_wp_33_commentmeta' doesn't exist

    So it seems it is not able to create the database tables. I am 100% positive that the database user has been granted all permissions. I even swapped out the username for the admin/root user to double check.

    I have followed all the wordpress standard instructions for setting up multi-site, and the site was working just fine a few days ago. The only thing I did was move to another server that was set up with the same software.

    I don't understand why the database tables are not getting created.

    I have disabled all plugins and tested it.

  2. Are you out of space on the DB?

    Is there a limit to tables in the DB? (Yes, some hosts do that)

    You may want to ask your webserver guru to see what restrictions are on the DB.

  3. paulhastings0
    Member
    Posted 2 years ago #

    We have exactly the same problem. I set up a fresh install of WP-MS 3.2.1 on a Media Temple Dedicated Virtual server. I believe it's using the latest versions of MySQL and PHP. The PHP is running as Fast CGI (as opposed to Apache) and everything's working fine... except for creating subdomains.

    It has all the symptoms described above. The database tables aren't created, neither are the folders in the wp-content/blogs.dir directory.

    Has anyone else experienced this or figured it out?

  4. The blogs.dir folders - Make you create blogs.dir and set the permissions right (I don't know what they need to be for fastCGI, but for me it was 755 and then some additional tweaking for DSO to be happy).

    The databases - Make sure the DB account you're using has FULL access to the database.

  5. paulhastings0
    Member
    Posted 2 years ago #

    When you say "Full" access, what exactly do you mean? Is this a setting in Plesk that can be set?

    (sorry for my ignorance, but Plesk is totally new to me)

  6. Full access to the DB means read/write/add everything. In mySQL on cPanel you can tell it to grand limited access that lets you add everything BUT tables, for example.

  7. paulhastings0
    Member
    Posted 2 years ago #

    Arghh... I'm looking through Plesk right now for something like that but not having any luck beyond being able to change the database user's password.

    I wish there was some way to contact @serialboxhpc and find out if/how he ever got his issue resolved.

  8. The database tables aren't created, neither are the folders in the wp-content/blogs.dir directory.

    Please remember that the blogs.dir files are used for media files *only*. Creating a new and fully working subsite will not a a darn thing to the blogs.dir folder. They don't live there.

    So that's one less thing you need to look at / worry about. ;)

  9. paulhastings0
    Member
    Posted 2 years ago #

    Thanks, @Andrea_r

    At this point I'm leaning towards @Ipstenu's hunch about the MySQL user not having table creation permissions. I'll be shelling into the site on Monday to find out. I'll let yall know what I discover.

  10. paulhastings0
    Member
    Posted 2 years ago #

    Alright, we narrowed down the source of our issue. The database user was fine, it was actually problem with the WooCommerce plugin.

    We notified them of the issue and they quickly made a fix. You can see the patched file on GitHub here: https://github.com/woothemes/woocommerce/commit/b3fa95c3eae9825934825d958360b49ea5cc0d08

    Basically they replaced

    if (get_site_option('woocommerce_db_version') != WOOCOMMERCE_VERSION) add_action('init', 'install_woocommerce', 0);

    with

    if (get_option('woocommerce_db_version') != WOOCOMMERCE_VERSION) add_action('init', 'install_woocommerce', 0);

    I just tried their fix on our site and it's working like charm now. New sites, database tables, etc.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags