MySQL server has gone away issues

Discussion in 'Installation/Configuration' started by GarGamel55, Sep 7, 2011.

  1. GarGamel55

    GarGamel55 New Member

    Hi,

    I can't solve this problem :
    Code:
     **Unmatched Entries**
        NOTICE: reconnecting in response to: err=2006, HY000, DBD::mysql::st execute failed: MySQL server has gone away at (eval 103) line 166, <GEN81> line 4.: 1 Time(s)
        NOTICE: reconnecting in response to: err=2006, HY000, DBD::mysql::st execute failed: MySQL server has gone away at (eval 103) line 166, <GEN129> line 4.: 1 Time(s)
    In my.cnf, i've add

    max_connections = 500
    max_user_connections = 500

    Code:
    [mysqld]
    #
    # * Basic Settings
    #
    user            = mysql
    pid-file        = /var/run/mysqld/mysqld.pid
    socket          = /var/run/mysqld/mysqld.sock
    port            = 3306
    basedir         = /usr
    datadir         = /var/lib/mysql
    tmpdir          = /tmp
    language        = /usr/share/mysql/english
    [B]max_connections = 500
    max_user_connections = 500[/B]
    skip-external-locking
    

    netstat -tap 's output
    Code:
    tcp        0      0 localhost.localdo:spamd *:*                     LISTEN      3214/spamd.pid
    tcp        0      0 *:www                   *:*                     LISTEN      2984/nginx
    tcp        0      0 nsxxxxx.ovh.net:domain *:*                     LISTEN      4659/named
    tcp        0      0 localhost.locald:domain *:*                     LISTEN      4659/named
    tcp        0      0 localhost.localdoma:953 *:*                     LISTEN      4659/named
    tcp        0      0 *:smtp                  *:*                     LISTEN      713/smtpd
    tcp        0      0 *:28055                 *:*                     LISTEN      23533/pure-ftpd (SE
    tcp        0      0 *:29055                 *:*                     LISTEN      2967/sshd
    tcp        0      0 localhost.localdo:10024 *:*                     LISTEN      627/amavisd (ch10-a
    tcp        0      0 localhost.localdo:10025 *:*                     LISTEN      3674/master
    tcp        0      0 *:mysql                 *:*                     LISTEN      3205/mysqld
    tcp        0     52 nsxxxxx.ovh.net:29055  xxxxxxxxxx:57282 ESTABLISHED 32157/sshd: yyyy
    tcp        0      0 localhost.localdo:mysql localhost.localdo:43766 ESTABLISHED 3205/mysqld
    tcp        0      0 localhost.localdo:mysql localhost.localdo:43133 ESTABLISHED 3205/mysqld
    tcp        0      0 localhost.localdo:43766 localhost.localdo:mysql ESTABLISHED 21163/amavisd (ch10
    tcp        0      0 localhost.localdo:43133 localhost.localdo:mysql ESTABLISHED 627/amavisd (ch10-a
    tcp6       0      0 [::]:pop3               [::]:*                  LISTEN      2622/couriertcpd
    tcp6       0      0 [::]:imap2              [::]:*                  LISTEN      2627/couriertcpd
    tcp6       0      0 [::]:http-alt           [::]:*                  LISTEN      3437/apache2
    tcp6       0      0 [::]:www                [::]:*                  LISTEN      2984/nginx
    tcp6       0      0 [::]:tproxy             [::]:*                  LISTEN      3437/apache2
    tcp6       0      0 [::]:50443              [::]:*                  LISTEN      3437/apache2
    tcp6       0      0 [::]:domain             [::]:*                  LISTEN      4659/named
    tcp6       0      0 ip6-localhost:953       [::]:*                  LISTEN      4659/named
    tcp6       0      0 [::]:https              [::]:*                  LISTEN      3437/apache2
    tcp6       0      0 [::]:28055              [::]:*                  LISTEN      23533/pure-ftpd (SE
    tcp6       0      0 [::]:imaps              [::]:*                  LISTEN      2640/couriertcpd
    tcp6       0      0 [::]:pop3s              [::]:*                  LISTEN      2634/couriertcpd
    tcp6       0      0 [::]:29055              [::]:*                  LISTEN      2967/sshd
    tcp6       0      0 nsxxxxxx.ovh.net:imap2 xxxxxxxxxxx:56399 ESTABLISHED 31226/imapd
    tcp6       0      0 nsxxxxxx.ovh.net:imap2 xxxxxxxx:56485 ESTABLISHED 31621/imapd
    
    and /etc/amavis/conf.d/50-user
    Code:
    use strict;
    
    #
    # Place your configuration directives here.  They will override those in
    # earlier files.
    #
    # See /usr/share/doc/amavisd-new/ for documentation and examples of
    # the directives you can use in this file
    #
    
    @bypass_virus_checks_maps = (
       \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
    
    @bypass_spam_checks_maps = (
       \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);
    
    #
    # Database connection settings
    #
    
    @lookup_sql_dsn =
       ( ['DBI:mysql:database=dbispconfig;host=127.0.0.1;port=3306', 'ispconfig', '6Ovs6BkOVS56ybEXJcYDBqFdT9hujez4'] );
    
    # @storage_sql_dsn = @lookup_sql_dsn;  # none, same, or separate database
    #$sql_select_policy = 'SELECT "Y" as local FROM mail_domain WHERE CONCAT("@",domain) IN (%k)';
    # $banned_files_quarantine_method = 'sql';
    # $spam_quarantine_method         = 'sql';
    
    #
    # SQL Select statements
    #
    
    $sql_select_policy =
       'SELECT *,spamfilter_users.id'.
       ' FROM spamfilter_users LEFT JOIN spamfilter_policy ON spamfilter_users.policy_id=spamfilter_policy.id'.
       ' WHERE spamfilter_users.email IN (%k) ORDER BY spamfilter_users.priority DESC';
    
    
    $sql_select_white_black_list = 'SELECT wb FROM spamfilter_wblist'.
        ' WHERE (spamfilter_wblist.rid=?) AND (spamfilter_wblist.email IN (%k))' .
        ' ORDER BY spamfilter_wblist.priority DESC';
    
    #
    # Quarantine settings
    #
    
    $final_virus_destiny = D_BOUNCE;
    $final_spam_destiny = D_DISCARD;
    $final_banned_destiny = D_BOUNCE;
    $final_bad_header_destiny = D_PASS;
    
    # Default settings, we st this very high to not filter aut emails accidently
    $sa_spam_subject_tag = '***SPAM*** ';
    $sa_tag_level_deflt  = 20.0;  # add spam info headers if at, or above that level
    $sa_tag2_level_deflt = 60.0; # add 'spam detected' headers at that level
    $sa_kill_level_deflt = 60.0; # triggers spam evasive actions
    $sa_dsn_cutoff_level = 100;   # spam level beyond which a DSN is not sent
    
    #
    # Disable spam and virus notifications for the admin user.
    # Can be overridden by the policies in mysql
    #
    
    $virus_admin = undef;
    $spam_admin = undef;
    
    
    #
    # Enable Logging
    #
    
    $DO_SYSLOG = 1;
    $LOGFILE = "/var/log/amavis.log";  # (defaults to empty, no log)
    
    # Set the log_level to 5 for debugging
    $log_level = 0;                # (defaults to 0)
    
    
    #------------ Do not modify anything below this line -------------
    1;  # insure a defined return
    
    Can you help me ?
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Does it work without these changes?

    Can you log into MySQL on the command line?
     
  3. GarGamel55

    GarGamel55 New Member

    Hi Falko,

    Strange, i don't have this message every day (1 day of 2)

    same problem

    when i try mysql -uispconfig -p, i'can't loggin (wrong password), but in panel all is ok, i can create a site, dns, ftp user etc ....

    do I reset the password for ispconfig ?

    In /etc/amavis/conf.d/50-user : 6Ovs6BkOVS56ybEXJcYDBqFdT9hujez4 is md5 ?
     
  4. falko

    falko Super Moderator ISPConfig Developer

    Maybe it is a problem with your RAM or your load. Do you have munin installed so that you can check what the problem might be?

    Is this a physical server or a virtual machine?
     
  5. GarGamel55

    GarGamel55 New Member

    It's a new physical server with 32GB RAM

    I check the ram, all is ok
     
  6. falko

    falko Super Moderator ISPConfig Developer

    I suggest you install munin to find out what's going on. Maybe it's a problem with your hard drive I/O.
     

Share This Page