• Resolved larry long

    (@larry-long)


    I have a wordpress multisites setup in a subdirectory “wpmu” under our main website. Currently, there is only one blog in it.

    After I log in the admin page, every thing under “My Sites”-> my blog site works correctly. But, if I click “my sites”->”network admin”-> “dashboard”, I got the error message below
    ————-
    Error establishing database connection

    If your site does not display, please contact the owner of this network. If you are the owner of this network please check that MySQL is running properly and all tables are error free.

    Could not find site *******. Searched for table wpmu_blogs in database ********. Is that right?

    What do I do now? Read the bug report page. Some of the guidelines there may help you figure out what went wrong. If you’re still stuck with this message, then check that your database contains the following tables:

    wpmu_users
        wpmu_usermeta
        wpmu_blogs
        wpmu_signups
        wpmu_site
        wpmu_sitemeta
        wpmu_registration_log
        wpmu_blog_versions

    I check my database, all those tables are there. I googled all possible reasons and tried many. Nothing seems to work.

    I attached the wp-config.php below

    define('WP_ALLOW_MULTISITE', true);
    
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    $base = '/wpmu/';
    define( 'DOMAIN_CURRENT_SITE', 'aaccc.org' );
    define( 'PATH_CURRENT_SITE', '/wpmu/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 7 );

    I also attached the .htaccess file below

    RewriteEngine On
    RewriteBase /wpmu/
    
    # Rewrite www.domain.com to domain.com
    RewriteCond %{HTTP_HOST} ^www\.(.*)
    RewriteRule ^(.*)       https://%1/$1 [R,L]
    
    #uploaded files
    RewriteRule ^(.*)?/?files/(.*) wp-content/blogs.php?file=$2 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    Please give me any direction that I may try.

Viewing 14 replies - 1 through 14 (of 14 total)
  • I think you did not install WP in the subdirectory properly. This is the page that provides the details:
    https://codex.www.ads-software.com/Giving_WordPress_Its_Own_Directory

    Thread Starter larry long

    (@larry-long)

    Thanks jkhongusc for the link and suggestion. I tried the following, and still run into database connection issues.

    1) I found my wordpress is older version 3.4.1. I updated it to latest version 4.1.1, The wordpress blog site works fine.

    If I click “network admin”->”dashboard”. I run into the exactly the same problem as I stated in my first post above.

    3) After update to wordpress 4.1.1, I copied the .htaccess file from my home site “aaccc.org” from the wordpress subdirectory “aaccc.org/wpmu” to the site root directory “www” (by the way, the wordpress directory wpmu is under www directory). Nothing changed.

    3) After above steps, I copied the index.php from wordpress directory wpmu to the website root directory www. After this change, funny things happened. The wordpress blog site still works as before. The “network admin” link still gave me the same error message.

    The funny part is the new “index.php” seems to hijack my home site “aaccc.org”, it seems to override the index.htm file in my home site root directory, and it re-direct everything to the blog “aaccc.org/wpmu”. This gave me the “error establish database connection” message.

    Any suggestion on how to overcome the conflict between the index.htm ad index.php in my home site root directory?

    Many thanks.

    Larry
    03/26/15

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    The funny part is the new “index.php” seems to hijack my home site “aaccc.org”, it seems to override the index.htm file in my home site root directory

    Well … Yes, it would. You can only have one index.

    And WP won’t work if index.php isn’t the primary index.

    jkhongusc, why did you think he needed to move things? If he wanted aaccc.org/wpmu/ then that’s FINE. There’s nothing in his questions that indicated that wasn’t what he wanted.

    Larry, a few things.

    1) Stop signing your posts ?? We can see who you are and the date on each post.

    2) What do you want the URLs to be for your WordPress network? That is, what do you want the MAIN site to be, what do you want the subsites to be?

    3) What tables DO you have in your DB?

    Thread Starter larry long

    (@larry-long)

    Thanks Mika for the quick response. Actually. you can directly check the website that I am maintaining.
    The main website
    https://www.aaccc.org

    which is a Church’s main website. you can see weird characters if you do not have correct language pack installed.

    The installation directory of the blog is wpmu. The URL to the Church’s blog is

    aaccc.org/wpmu/mandarin

    There are too many tables in my DB. I listed some below

    wpmu_blogs
    wpmu_blog_versions
    wpmu_commentmeta
    wpmu_comments
    wpmu_links
    wpmu_options
    wpmu_postmeta
    wpmu_posts
    wpmu_registration_log
    wpmu_signups
    wpmu_site
    wpmu_sitecategories
    wpmu_sitemeta
    wpmu_terms
    wpmu_term_relationships
    wpmu_term_taxonomy
    wpmu_usermeta
    wpmu_users

    ——-
    tables for the blog

    wpmu_7_blogs
    wpmu_7_blog_versions
    wpmu_7_commentmeta
    wpmu_7_comments
    wpmu_7_links
    wpmu_7_options
    wpmu_7_postmeta
    wpmu_7_posts
    wpmu_7_registration_log
    wpmu_7_signups
    wpmu_7_site
    wpmu_7_sitecategories
    wpmu_7_sitemeta
    wpmu_7_terms
    wpmu_7_term_relationships
    wpmu_7_term_taxonomy
    wpmu_7_usermeta
    wpmu_7_useronline
    wpmu_7_users

    ——————
    some old tables that I do not use any more

    wp_blogs
    wp_blog_versions
    wp_commentmeta
    and few more wp_* files

    wp_1_categories
    wp_1_comments
    wp_1_link2cat
    wp_1_links
    and few more wp_1_* files.

    Thanks.

    Larry –
    Sorry if I misunderstood you and lead you astray with the WordPress in its own directory link… you only do that if you want to run WP out of root, but install in a subdirectory. I see now you want to install WP in a subdirectory AND run out of that subdirectory.

    For fun, I just did a WP in a subdirectory installation. I had slightly different settings than you. Just wondering how you came to your .htaccess and wp-config.php configurations. I used info displayed in the wp-admin -> Network Admin -> Settings -> Network Setup

    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'www.domain.com');
    define('PATH_CURRENT_SITE', '/wpsubdir/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    RewriteEngine On
    RewriteBase /wpsubdir/
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    The thing that stuck out the most for me in your configuration is the base config:
    $base = '/wpmu/';

    Larry –
    You need to undo some of those changes… namely removing the .htaccess and index.php from the root. Make sure you still have those files in /wpmu.

    And you didnt answer Mika’s question #2
    2) What do you want the URLs to be for your WordPress network? That is, what do you want the MAIN site to be, what do you want the subsites to be?

    Do you want your WP network to start at aaccc.org/wpmu? And your subsites in aaccc.org/wpmu/[subsites]? You have it setup this way now, but it might not be what you really want.

    Thread Starter larry long

    (@larry-long)

    Thanks Jkhongusc.
    Just removed .htaccess and index.php from root directory of my website (not wordpress directory).

    By the way, I used the .htaccess and wp-config.php from my old version wordpress. I will try to replace my old commands with the new one you listed above to see if it works.

    Regarding the Mika’s second question
    I want the URL to the wordpress network to be “aaccc.org/wpmu”
    The URL to the blog to be “aaccc.org/wpmu/mandarin”

    Larry –
    You should be using the settings that are in the WP Network admin menu from your WP installation. It might be a different version with different configurations. Look it up this way: wp-admin -> Network Admin -> Settings -> Network Setup

    As I mentioned before the only odd thing I notice is the $base defined in wp-config.php; but it may be due to your version of WP.

    Thread Starter larry long

    (@larry-long)

    jkhongusc,
    Just removed the $base=/wpmu/ from wp-config.php, and re-tested. No difference.

    When I click
    wp-admin-> My Site-> Network Admin

    Then I got the “error connecting database” message shown in the first post.

    By the way, I contacted the web hosting company regarding this issues. I was told, the error message was due to “too many queries” to the database caused the server to shut down”. Since not many people currently use our blog. The possible reason from them is due to error or loop in scrip. This information is helpful. But I am not sure where to start to check.

    I will use the new wp-config.php and .htaccess to try.

    Larry –
    You are doing something out of the ordinary. You are directing or redirecting users to blog_id=7 as your main site (instead of blog_id=1). This is unusual and I do not have experience doing that. How did you come to those settings in wp-config.php?

    Have you considered undoing those changes temporarily? For example backup your wp-config.php and set it to the “standard” setting:

    define('WP_ALLOW_MULTISITE', true);
    
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    $base = '/wpmu/';
    define( 'DOMAIN_CURRENT_SITE', 'aaccc.org' );
    define( 'PATH_CURRENT_SITE', '/wpmu/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    Then see if you can access your Network Admin menu. See if that works. You may be able to figure out how to redirect to blog_id=7 from scratch.

    **Edit – you only need to change the BLOG_ID_CURRENT_SITE to 1

    Thread Starter larry long

    (@larry-long)

    Just changed BLOG_ID_CURRENT_SITE to 1, and re-tested. No difference.

    Thread Starter larry long

    (@larry-long)

    Just cut and pasted the .htaccess file and wp-config.php you gave above to my wpmu directory. Same results as before. The blog site is working. The Network Admin site is not working.

    Thread Starter larry long

    (@larry-long)

    I thought about the issues last night. There are actually two issues involved.
    1) The first is the installation of wordpress in the subfolder which is “wpmu” in my case, and it is under my root directory “www”. From all the tests I did yesterday. It looks the subfolder installation of wordpress is correct.

    2) The second one is actually the multisites, in my case, my blog which is “aaccc.org/wpmu/mandarin” is working. But the netword admin is not working.

    This lead to think that one possible reason is related to the database table I am using right now.

    For your information, the database I am using right now is from the original single site database, there are a lot a garbages in it. The site URL in some table my not be correct.

    —————————

    Please correct me if I am wrong below:

    my wordpress site is “aaccc.org/wpmu”. My blog site is “aaccc.org/wpmu/mandarin”. I assume that when I call my blog “aaccc.org/wpmu/mandarin”, wordpress will star the site “aaccc.org/wpmu”, and read the database table “wpmu_****”, from the table “wpmu_blogs” to find the my blog “aaccc.org/wpmu/mandarin” is using table 7.

    Then wordpress will read everything using table wpmu_7_*

    I want to check the following whether they are defined correctly.
    1) in my blog table “wpmu_7_site”, the site is domain “aaccc.org” path “/wpmu/”, this is the path to the wordpress root, not to my blog.

    2) wpmu_7_blog, domain “aaccc.org”, path is “/wpmu/mandarin/” which is not the same as in the table wpmu_7_site shown above.

    3) in wpmu_7_options, the siteurl is “https://aaccc.org/wpmu/mandarin/” which not the same as in wpmu_7_site, or wpmu_7_blog. Not sure whether I need to change this to my root wordpress which is “aaccc.org/wpmu/” or not?
    The option_name “home” is “https://aaccc.org/wpmu/mandarin/”, not sure this is the home of my root website or home of my wordpress, or the home of my blog.

    Thread Starter larry long

    (@larry-long)

    Finally, Problem solved. Cheeeeeeeeeeeeeeeeeeeeer!!!!!!!!!!!

    ————————————

    Solution which may be helpful for others.

    Actually, the solution is very simple.
    I went to the root table of my wordpress site which is wpmu_***. In the table wpmu_blogs. I added the following blog, blog id “1”, site id “1”, domain “aaccc.org”, path “/wpmu/”. Not sure the exact cause. Maybe the wordpress network admin is not working when you only have one blog.

    Thanks jkhonguscand and Mika for quick helping.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘click "network admin"-> "dashboard" leads to error "Error establishing d’ is closed to new replies.