Can't connect to MySQL server

Discussion in 'Installation/Configuration' started by Fumble, Nov 20, 2013.

  1. Fumble

    Fumble Member

    Can't connect to MySQL server (DB::__construct Can't connect)

    Hello,

    I run a multiple server configuration in 3.0.5.3.

    I recently update from 3.0.4 to 3.0.5.3. Since then, master can't push configuration on slave anymore...

    I can see add in the master database, but not on slaves.

    Hosts file are fine (it use to work) I also can telnet mysql from slave to master.

    I can see this in /var/log/ispconfig/cron.log on the master:

    Code:
    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 72
    DB::__construct Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
    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 72
    PHP Warning:  mysqli::close(): Couldn't fetch db in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 82
    And, on one of the slaves server (guest they are all like this):

    Code:
    DB::__construct Can't connect to MySQL server on 'exploitation.hosting.infra' (111)
    PHP Warning:  mysqli::mysqli(): (HY000/2003): Can't connect to MySQL server on 'mymasterserver' (111) in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 72
    DB::__construct Can't connect to MySQL server on 'mymasterserver' (111)
    PHP Warning:  mysqli::mysqli(): (HY000/2003): Can't connect to MySQL server on 'mymasterserver' (111) in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 72
    PHP Warning:  mysqli::close(): Couldn't fetch db in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 82
    Any help would be appreciate. Thank you
     
    Last edited: Nov 20, 2013
  2. Fumble

    Fumble Member

    In addition, I tried to this:

    from slave:
    mysql -u root -p
    mysql -h panelServerIP -u root -p

    this is OK
     
  3. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Have you answered "reconfigure permissions on master" with yes on slave-update? This is important.
     
  4. Fumble

    Fumble Member

    Yes I did, at least on one of the slaves (I have 9 slaves) as said here:
    http://www.faqforge.com/linux/controlpanels/ispconfig3/how-to-update-ispconfig-3/

    It is probably important to say that during the update, I also updated my OS (I mean, just an apt-get upgrade). And, maybe more important, I got some error when updating IspConfig about table, but just warning, not blocking error.

    If I remember well, something like: "Unknown column 'error' in 'sys_datalog'"

    I supposed it was because of a database structure modification or something

    thanks
     
    Last edited: Nov 20, 2013
  5. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Ok, I hope you are not using ubuntu and have upgraded to something newer than 12.04 as ISPConfig is not yet compatible with this.

    Try running an ISPConfig update on one of the slaves again (with reconfigure = yes and privileges = yes) and check if this server has no more errors.
     
  6. Fumble

    Fumble Member

    That's a good idea, but, am I suppose to be able to run ispconfig_update.sh again?

    If I do, it says that there is no update available.... Which is true :)

    How can I do? (sorry if it s a stupid question)
     
  7. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Just download ISPConfig from the website and call "php -q update.php" from the "install/" directory.
     
  8. Fumble

    Fumble Member

    I just did what you suggested Croydon and that's OK now! So thank you very much.
    Next upgrade, I will automatically say "yes" to the reconfigure questions on all the slaves, not only on one.

    Thank you very much.
     

Share This Page