[resolved] "Error establishing a database connection" adding new site (26 posts)

  1. Wiki Chaves
    Posted 5 years ago #


    I had originaly my Site using "regular" WP 3.0, and transformed into Multisite.

    Now i want to create a secondary site under SuperAdmin/Sites and when I create a new site i can not access it.

    My original site is running OK

    but my new site shows me "Error establishing a database connection"

    Also when I press the "Visit" link under SuperAdmin/Sites it drives me to http://revistadepunta.com/wp-admin/ms-sites.php?updated=true&action=add-blog instead of http://revistadepunta.com/test/

    Any idea ??


  2. And you went through all the create a network steps as outlined in the codex?
    And you turned off plugins?

  3. Wiki Chaves
    Posted 5 years ago #

    Hi Andrea,

    Yes, i went all the steps:

    1) I've first "moved" mi WP installation to root directory since i had ir under /wordpress/ directory

    2) i've changed my wordpress directory to match my site URL

    3) disabled plugins

    4) added define('WP_ALLOW_MULTISITE', true); to wp-config

    5) run Tools/Network install

    6) Added lines to wp-config & .httaccess

    7) enabled plugins

    8) added a new site

    The most surprising point is that anoying thing is that on my secondary site (http://revistadepunta.com/test/) it shows me "Error establishing a database connection" and the root site (http://revistadepunta.com) rusn OK

    i have some experience installing multisite and WPMU, but i haven't seen this kind of error before.

    thanks !

  4. Yeah, with the network feature built in now, getting the db error shouldn't ever happen. because you're already installed, you know?

    I gotta go pick the brain of one of the devs.

  5. Wiki Chaves
    Posted 5 years ago #

    Exactly !

    Thanks for your help :)

  6. If I go to http://revistadepunta.com/test/wp-admin/

    I get this:

    Una tabla o más de la base de dato no están disponibles. La base de datos debe ser reparada.

    Have you tried a repair of the database?

  7. Wiki Chaves
    Posted 5 years ago #

    Oh, i didn't seen that,

    and how do i repair my DB ?
    If i click on "Repail" it show me a sighn of "Updating SEO configuration options in database"

    any idea ?

  8. Wiki Chaves
    Posted 5 years ago #

    here is what is shows me now !

    wp_8_posts: Table 'dpunta_wrdp1.wp_8_posts' doesn't exist
    wp_8_comments: Table 'dpunta_wrdp1.wp_8_comments' doesn't exist
    wp_8_links: Table 'dpunta_wrdp1.wp_8_links' doesn't exist
    wp_8_options: Table 'dpunta_wrdp1.wp_8_options' doesn't exist
    wp_8_postmeta: Table 'dpunta_wrdp1.wp_8_postmeta' doesn't exist
    wp_8_terms: Table 'dpunta_wrdp1.wp_8_terms' doesn't exist
    wp_8_term_taxonomy: Table 'dpunta_wrdp1.wp_8_term_taxonomy' doesn't exist
    wp_8_term_relationships: Table 'dpunta_wrdp1.wp_8_term_relationships' doesn't exist
    wp_8_commentmeta: Table 'dpunta_wrdp1.wp_8_commentmeta' doesn't exist

  9. Wiki Chaves
    Posted 5 years ago #

    i think is something with plugins
    i've disabled all plugins, created a new site (http://revistadepunta.com/test2/) and worked

    I think my steps 7 & 8 should be donde in the oposite way

    7) add a new site

    8) enable plugins


  10. Yep, then it was likely a plugin.

  11. Wiki Chaves
    Posted 5 years ago #


    2 plugins were causing the problem when "Network activation" was applied:

    All in One SEO Pack: http://semperfiwebdesign.com/

    Banner Rotator: http://tribulant.com/products/view/2/wordpress-banner-rotator-plugin

    Thanks !

  12. wclark
    Posted 5 years ago #

    It seems like I am having the same error.

    But I do not have any plugins activated.

    I am running WordPress 3.0

    My main site works great: blogs.mobilitysales.com
    I have 1 secondary site that works great: blogs.mobilitysales.com/rapid-city-sd

    Now when I attempt to create a 2nd secondary site, I get the same symtoms as above.

    When I try a database repair for the secondary site it doesn't work.
    wp_11_posts: Table 'wordpress-mu.wp_11_posts' doesn't exist
    wp_11_comments: Table 'wordpress-mu.wp_11_comments' doesn't exist
    wp_11_links: Table 'wordpress-mu.wp_11_links' doesn't exist
    wp_11_options: Table 'wordpress-mu.wp_11_options' doesn't exist
    wp_11_postmeta: Table 'wordpress-mu.wp_11_postmeta' doesn't exist
    wp_11_terms: Table 'wordpress-mu.wp_11_terms' doesn't exist
    wp_11_term_taxonomy: Table 'wordpress-mu.wp_11_term_taxonomy' doesn't exist
    wp_11_term_relationships: Table 'wordpress-mu.wp_11_term_relationships' doesn't exist
    wp_11_commentmeta: Table 'wordpress-mu.wp_11_commentmeta' doesn't exist
    wp_sitemeta: 2 clients are using or haven't closed the table properly

    Any suggestions would be great!


  13. qdinar
    Posted 5 years ago #

    try to uncomment define( 'MULTISITE', true );
    try to run /wp-admin/ms-upgrade-network.php ,
    try to set english interface .

  14. anabelle
    Posted 5 years ago #

    I am now having the same issue.

    I've already tried removing all plugins and mu-plugins.

    I've tried creating the new site from admin, and by registering it as a user.

    I've set up the english interface.

    But the result is always the same, The blog gets created as well as the user, but not all the tables get to the database so the error stablishing connection message appears.

    What else can I try?

  15. The blog gets created as well as the user, but not all the tables get to the database so the error stablishing connection message appears.

    Check that the SQL id you're using has permissions to create new tables in your database. You may need to ask your host to check on that for you.

  16. anabelle
    Posted 5 years ago #

    Thanks for your suggestion.

    I've checked and it's currently: (Privileges: ALL PRIVILEGES) for the user accesing the database.

    Any other Ideas?

  17. anabelle
    Posted 5 years ago #

    I found, in: http://codex.wordpress.org/Debugging_a_WordPress_Network

    Also, on very few upgrades from WordPressMU to 3.0 and up, a small number of users experienced a problem with creating new sites and receiving errors. This turned out to be a database collation issue"

    Is there any more info on this one? I am using WordPress MU since version 1.5 if I remember well. And upgraded to 3.0

  18. O Ofutur
    Posted 5 years ago #

    Seems like Defensio is preventing the creation of the tables when adding a new site.

    It would be great if an exception could be raised when something like this happens.

    It's almost impossible to debug atm. We just have to turn off plugins one by one, but it's not feasible in production.

  19. @Oliver - you'll have to start a new thread with your own specific issues.

  20. O Ofutur
    Posted 5 years ago #


  21. Marjolijn Harvey
    Posted 5 years ago #

    Hello all,

    I've got the same problem om http://www.driverszone.co.uk
    The site is working (although still under construction) and blog creation was working. until one day, suddenly when creating a test blog, i got database error. and again when creating a another test blog.

    I tried repairing it and got this code to copy paste in here:
    wp_usermeta: 1 client is using or hasn't closed the table properly
    wp_19_posts: Table 'driversz_engine.wp_19_posts' doesn't exist
    wp_19_comments: Table 'driversz_engine.wp_19_comments' doesn't exist
    wp_19_links: Table 'driversz_engine.wp_19_links' doesn't exist
    wp_19_options: Table 'driversz_engine.wp_19_options' doesn't exist
    wp_19_postmeta: Table 'driversz_engine.wp_19_postmeta' doesn't exist
    wp_19_terms: Table 'driversz_engine.wp_19_terms' doesn't exist
    wp_19_term_taxonomy: Table 'driversz_engine.wp_19_term_taxonomy' doesn't exist
    wp_19_term_relationships: Table 'driversz_engine.wp_19_term_relationships' doesn't exist
    wp_19_commentmeta: Table 'driversz_engine.wp_19_commentmeta' doesn't exist
    wp_sitemeta: 1 client is using or hasn't closed the table properly

    How can this be fixed please :)

  22. Tim Moore

    Posted 5 years ago #

    @mafgirl: start a new thread please. You'll get more help that way.

  23. Marjolijn Harvey
    Posted 5 years ago #

  24. iain.norman
    Posted 5 years ago #

    I had the same problem connecting to database for all sub domain sites, the fix came from removing www. from the main site url in WP admin, but also switching off www. prefix in my domain configuration panel on the server (plesk), then it all worked fine.

  25. anabelle
    Posted 5 years ago #

    We solved this.

    First of all the problem was with databases connection
    my main concern was that privileges will be the problem

    I granted all privileges but didn't work

    I backed up all the website, started debugging, creating new db user, and granted him the priviliages. db error went away, but mu refused to work.

    when added new user in wp-config.php I used the standard pattern of config file instead of spanish comments, wpmu was disabled there, and I enabled that.

    It worked :)

  26. Gabe Arnold
    Posted 4 years ago #

    @Wiki Chaves thanks for the simple fix, I disabled plugins, then created sites, and then re-enabled plugins. I didn't get the "Error establishing a database connection" after that. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic