Database connection error (2): Could not connect to MySQL after PHP upgrade

Discussion in 'Installation/Configuration' started by pawan, Feb 18, 2013.

  1. pawan

    pawan Member

    I have upgraded my php from 5.3 to 5.4 and now I am getting frequent mysql error:
    Database connection error (2): Could not connect to MySQL

    is it related to php upgrade or some other reason.

    I am also getting this error when I trying to log on ISPCONFIG admin

    Code:
    DB::__construct Too many connectionsDB::__construct Too many connectionsDB::query(SELECT * FROM sys_session WHERE session_id = '') -> mysqli_query Too many connections#0 db
    ISPCONFIG SERVER LOG
    Code:
    PHP Warning: mysqli::close(): Couldn't fetch db in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 70
    Failed loading /usr/lib/php5/20090626/xcache.so: /usr/lib/php5/20090626/xcache.so: cannot open shared object file: No such file or directory
    Failed loading /usr/lib/php5/20090626/xcache.so: /usr/lib/php5/20090626/xcache.so: cannot open shared object file: No such file or directory
    Failed loading /usr/lib/php5/20090626/xcache.so: /usr/lib/php5/20090626/xcache.so: cannot open shared object file: No such file or directory
    PHP Warning: mysqli::mysqli(): (08004/1040): Too many connections in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 61
    DB::__construct Too many connections
    PHP Warning: mysqli::query(): Couldn't fetch db in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 65
    PHP Warning: mysqli::query(): Couldn't fetch db in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 66
    PHP Warning: mysqli::ping(): Couldn't fetch db in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 106
    PHP Warning: mysqli::query(): Couldn't fetch db in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 107
    PHP Warning: mysqli::escape_string(): Couldn't fetch db in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 166
    PHP Warning: mysqli::ping(): Couldn't fetch db in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 106
    PHP Warning: mysqli::query(): Couldn't fetch db in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 107
    PHP Warning: mysqli::close(): Couldn't fetch db in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 70
    Failed loading /usr/lib/php5/20090626/xcache.so: /usr/lib/php5/20090626/xcache.so: cannot open shared object file: No such file or directory
    Failed loading /usr/lib/php5/20090626/xcache.so: /usr/lib/php5/20090626/xcache.so: cannot open shared object file: No such file or directory
    Failed loading /usr/lib/php5/20090626/xcache.so: /usr/lib/php5/20090626/xcache.so: cannot open shared object file: No such file or directory
    Failed loading /usr/lib/php5/20090626/xcache.so: /usr/lib/php5/20090626/xcache.so: cannot open shared object file: No such file or directory
    Failed loading /usr/lib/php5/20090626/xcache.so: /usr/lib/php5/20090626/xcache.so: cannot open shared object file: No such file or directory
    Failed loading /usr/lib/php5/20090626/xcache.so: /usr/lib/php5/20090626/xcache.so: cannot open shared object file: No such file or directory
    Failed loading /usr/lib/php5/20090626/xcache.so: /usr/lib/php5/20090626/xcache.so: cannot open shared object file: No such file or directory
    Failed loading /usr/lib/php5/20090626/xcache.so: /usr/lib/php5/20090626/xcache.so: cannot open shared object file: No such file or directory
    Failed loading /usr/lib/php5/20090626/xcache.so: /usr/lib/php5/20090626/xcache.so: cannot open shared object file: No such file or directory
    Failed loading /usr/lib/php5/20090626/xcache.so: /usr/lib/php5/20090626/xcache.so: cannot open shared object file: No such file or directory
    PHP Warning: mysqli::mysqli(): (HY000/2002): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 61
    DB::__construct Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
    
    I am also getting this error repeatadely in ispconfig log
    Code:
    ERROR - Plugins directory missing: /usr/local/ispconfig/server/plugins-core/
    
     
    Last edited: Feb 18, 2013
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    1) Set:

    max_connections = 500
    max_user_connections = 500

    in [mysqld] section of the /etc/mysql/my.cnf file and restart mysql.

    2) Your xcache extension does not seem to be correct for your new php version.

    3) Seems as if parts of your ispcnfig install have been removed if the directory /usr/local/ispconfig/server/plugins-core/ is missing.
     
  3. pawan

    pawan Member

    Thanks Till

    I have made the changes in mysql my.cnf file as per your suggestion and update you.

    what should I do for removing the xcahe error. I think I am not using xcache in any of the setup.

    Today I have upgrade my ispconfig installation, in there I also didn't find the plugins-core directory.
    I have checked the older backups, where there is a plugins-core directory, but that is empty.
    How can I restore this folder.

    Again I am getting another error repeatedly like this
    Code:
    PHP Warning: mysqli::escape_string(): Couldn't fetch db in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 204
    
    PHP Warning: mysqli::mysqli(): (08004/1040): Too many connections in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 71
    DB::__construct Too many connections
    
    my ispconfig version is 3.05 RC2.
     
    Last edited: Feb 18, 2013

Share This Page