• Amal 007

    (@amalitpace)


    Hi,

    I am having a multisite network hosted on cloud. I came across the error “Error establishing a database connection” both in front and back end for the 2nd time.First time i just restarted the server and the problem was solved, now the issue came back again after couple of weeks. This time i didnt tried restarting instead am trying to find the cause. Since am planning to have more users in my site i think its not fair to keep on restarting the server.

    I belive my wp-config is fine.At this stage i tried to test the db connection using following piece of code.

    <?php
    $link = mysql_connect('localhost', '*******', '*****');
    if (!$link) {
    die('Could not connect: ' . mysql_error());
    }
    echo 'Connected successfully';
    mysql_close($link);
    ?>

    and added this file to my www folder. when i run the file shows “Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111)”

    Can someone please help me with this…

    Thanks in advance 🙂

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Which cloud are you using? Amazon or someone else?

    Thread Starter Amal 007

    (@amalitpace)

    Thanks for your reply i am using digital ocean. I actually restarted the server because the site was alredy live and started with few users,site is fine again now dont know how long it goes.I googled it so much and coudnt find a solution other than restarting it 🙁
    Please help me with a solution that might be useful soon or later, because we only had couple of weeks gap between the current occurance and previous. Guess it may occur again may b within days.:(

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Same question applies. Who is your cloud provider? They all have slightly different ways of optimal setup when it comes to DB connections, and I don’t want to waste your time running down angles that you don’t use 🙂

    Thread Starter Amal 007

    (@amalitpace)

    I already mentioned that my cloud provider is “DigitalOcean“…I googled it so much to find whether its issue in wp or in server side but couldnt find it. Thank you 🙂

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Thread Starter Amal 007

    (@amalitpace)

    I didnt move my site i build the site there itself. Anyway thanks i didnt find the link you sent. I guess its the same error mentioned like the mysql getting crashed. Thankyou so much for your support Ipstenu (Mika Epstein) i will get back to u if the DO couldnt fix the issue. 🙂

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Yeah, sadly there isn’t as many folks using Multisite on the cloud like that as their might be :/ Less than IIS probably.

    Thread Starter Amal 007

    (@amalitpace)

    Oh thats why it was pretty tough for me in getting the issues similar to mine…I will have to upgrade the ram…currently am having only 4 or 5 sites in my network…dont know how far the expansion of ram is gona workout and also how much i need to expand…hope expanding it to 1gb will do the trick :)thanks for your support Ipstenu (Mika Epstein)

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Error establishing a database connection frequently’ is closed to new replies.