Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Database gone away

Discussion in 'Database Discussion' started by knightmare, Jul 23, 2018.

  1. knightmare

    knightmare Member

    Joined:
    May 31, 2018
    Messages:
    20
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello ,

    I am using Whm / cPanel in centos .

    I am facing issue of database connection last month .

    error ,

    Failed to connect to MySQL: MySQL server has gone away

    and

    Service Name

    mysql

    Service Status

    recovered ❇

    Notification

    The service “mysql” is now operational.

    Service Check Raw Output

    The 'mysql' service passed the check: mysql (/bin/sh /usr/bin/mysqld_safe) is running as mysql with PID 17331 (systemd+/proc check method).
    mysql (/usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=host.domain.com.err --open-files-limit=10000 --pid-file=host.domain.com.pid) is running as mysql with PID 17456 (systemd+/proc check method).

    Startup Log

    Jul 20 10:27:08 host.domain.com systemd[1]: Started MySQL Server.
    Jul 20 10:27:08 host.domain.com systemd[1]: Starting MySQL Server...
    Jul 20 10:27:09 host.domain.com mysqld_safe[17331]: 180720 10:27:09 mysqld_safe Logging to '/var/lib/mysql/host.domain.com.err'.
    Jul 20 10:27:09 host.domain.com mysqld_safe[17331]: 180720 10:27:09 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

    Log Messages

    2018-07-20 10:27:09 17456 [Note] /usr/sbin/mysqld: ready for connections.
    180720 10:27:09 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    180720 10:27:09 mysqld_safe Logging to '/var/lib/mysql/host.domain.com.err'.
    180720 10:22:54 mysqld_safe mysqld from pid file /var/lib/mysql/host.domain.com.pid ended
    2018-07-20 10:22:54 16904 [Note] /usr/sbin/mysqld: Shutdown complete
    180720 10:22:54 mysqld_safe mysqld restarted
    180720 10:22:54 mysqld_safe Number of processes running now: 0
    2018-07-20 07:42:51 32321 [Note] /usr/sbin/mysqld: ready for connections.


    How to solve this error ?
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,827
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Can you review the MySQL error log (/var/lib/mysql/$hostname.err) at the date/times before the MySQL service is restarted and let us know of any specific error messages?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. knightmare

    knightmare Member

    Joined:
    May 31, 2018
    Messages:
    20
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello ,

    Mysql error log ,

    2018-07-23 09:44:46 0 [Note] /usr/sbin/mysqld (mysqld 5.6.39) starting as process 20926 ...
    2018-07-23 09:44:46 20926 [Note] Plugin 'FEDERATED' is disabled.
    2018-07-23 09:44:46 20926 [Note] InnoDB: Using atomics to ref count buffer pool pages
    2018-07-23 09:44:46 20926 [Note] InnoDB: The InnoDB memory heap is disabled
    2018-07-23 09:44:46 20926 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
    2018-07-23 09:44:46 20926 [Note] InnoDB: Memory barrier is not used
    2018-07-23 09:44:46 20926 [Note] InnoDB: Compressed tables use zlib 1.2.3
    2018-07-23 09:44:46 20926 [Note] InnoDB: Using Linux native AIO
    2018-07-23 09:44:46 20926 [Note] InnoDB: Using CPU crc32 instructions
    2018-07-23 09:44:46 20926 [Note] InnoDB: Initializing buffer pool, size = 128.0M
    2018-07-23 09:44:46 20926 [Note] InnoDB: Completed initialization of buffer pool
    2018-07-23 09:44:46 20926 [Note] InnoDB: Highest supported file format is Barracuda.
    2018-07-23 09:44:46 20926 [Note] InnoDB: The log sequence numbers 2257816983 and 2257816983 in ibdata files do not match the log sequence number 3489146206 in the ib_logfiles!
    2018-07-23 09:44:46 20926 [Note] InnoDB: Database was not shutdown normally!
    2018-07-23 09:44:46 20926 [Note] InnoDB: Starting crash recovery.
    2018-07-23 09:44:46 20926 [Note] InnoDB: Reading tablespace information from the .ibd files...
    2018-07-23 09:44:48 20926 [Note] InnoDB: Restoring possible half-written data pages
    2018-07-23 09:44:48 20926 [Note] InnoDB: from the doublewrite buffer...
    2018-07-23 09:44:48 20926 [Note] InnoDB: 128 rollback segment(s) are active.
    2018-07-23 09:44:48 20926 [Note] InnoDB: Waiting for purge to start
    2018-07-23 09:44:48 20926 [Note] InnoDB: 5.6.39 started; log sequence number 3489146206
    2018-07-23 09:44:48 20926 [Note] Server hostname (bind-address): '*'; port: 3306
    2018-07-23 09:44:48 20926 [Note] IPv6 is available.
    2018-07-23 09:44:48 20926 [Note] - '::' resolves to '::';
    2018-07-23 09:44:48 20926 [Note] Server socket created on IP: '::'.
    2018-07-23 09:44:48 20926 [Note] Event Scheduler: Loaded 0 events
    2018-07-23 09:44:48 20926 [Note] /usr/sbin/mysqld: ready for connections.
    Version: '5.6.39' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
    180723 10:25:34 mysqld_safe Number of processes running now: 0
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,827
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    I don't see anything in the log output that explains why MySQL stopped. Can you verify if MySQL is still failing on a regular basis? If so, how often does it fail? Also, can you let us know the contents of the /etc/my.cnf file on this system?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. knightmare

    knightmare Member

    Joined:
    May 31, 2018
    Messages:
    20
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello ,

    My.cnf

    [mysqld]
    performance-schema=0
    max_connections=16000
    max_user_connections=5000
    performance-schema=0
    query_cache_type=1
    query_cache_size=512M
    query_cache_limit=16M
    performance-schema=0
    long_query_time=0.1
    performance-schema=0
    tmp_table_size=512M
    max_heap_table_size=512M
    performance-schema=0
    thread_cache_size=128
    table_open_cache=1024
    performance-schema=0
    wait_timeout=600
    interactive_timeout=300
    performance-schema=0
    innodb_file_per_table=1
    innodb_buffer_pool_size=4G
    performance-schema=0
    innodb_log_file_size = 600M
    innodb_log_buffer_size = 30M
    innodb_flush_method = O_DIRECT
    innodb_flush_log_at_trx_commit = 2
    innodb_old_blocks_time = 1000
    performance-schema=0
    default-storage-engine=MyISAM
    local-infile=0
    max_allowed_packet=4096M
    slow_query_log=1
    open_files_limit=45000
    performance-schema=0
    table_open_cache=16384
    join_buffer_size=200M
    performance-schema=0
    key_buffer_size=2G
     
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,827
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Can you verify if MySQL is still failing on a regular basis? If so, how often does it fail?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. knightmare

    knightmare Member

    Joined:
    May 31, 2018
    Messages:
    20
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello ,

    Everyday I am facing this error ,
    Failed to connect to MySQL: MySQL server has gone away

    Any mistake in my my.cnf ?
    Tell me whats the problem going on ?
    I want to solve this problem as soon as possibly .
     
  8. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,827
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Can you open a support ticket so we can take a closer look at the affected system? You can post the ticket number here and we will link this thread to the ticket.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice