Jump to:

23370 Posts in 18160 Topics by 2864 members

General Questions

SilverStripe Forums » General Questions » Couldn't connect to MySQL database

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 2740 Views
  • Dave L
    Avatar
    Community Member
    56 Posts

    Couldn't connect to MySQL database Link to this post

    Error: Couldn't connect to MySQL database
    At line 401 in /[edit]/sapphire/core/model/MySQLDatabase.php

    Couldn't connect to MySQL database
    Line 401 of MySQLDatabase.php
    MySQLDatabase->databaseError(Couldn't connect to MySQL database)
    Line 39 of MySQLDatabase.php
    MySQLDatabase->__construct(Array)
    Line 79 of DB.php
    DB::connect(Array)
    Line 112 of main.php

    Is anyone else receiving production errors along these lines? It seems sporadic, but I get emailed 2-3 times a month from different SS installs on different hosts. Not major, but then again some user somewhere is getting 500 response when accessing my sites. I'm wondering if it's a general error related to hosting provider networks, or something to do with SS response times if the site has been idle for a while. Any thoughts?

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: Couldn't connect to MySQL database Link to this post

    Hi Dave!

    I was thinking of starting the same thread myself. I’m getting this error several times a day. I doubt it’s SS-related, since nobody seems to complaint. The servers where I’m hosting my sites seems not too reliable, by the way I’m in the process of migrating from them…

    Regards,
    Juan

    EDIT: The error is sometimes: Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111

  • Dave L
    Avatar
    Community Member
    56 Posts

    Re: Couldn't connect to MySQL database Link to this post

    Hi Juan,

    Yea, could be a side effect of hosting providers usually pushing shared hosting to the limit. In any case, I got 2 errors in one minute from the same site at 9am today and another 3 in one minute at 10am. Hopefully it's not a trend.

    Dave

    2740 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.