mysql server stop working suddenly

December 1, 2019 126 views
MySQL WordPress MariaDB Ubuntu 18.04

I have installed litespeed wordrpress droplet, But today suddenly mysql stop working and error showing establish connection database, when i try to check the mysql status it show

● mariadb.service - MariaDB 10.3.18 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: failed (Result: exit-code) since Sun 2019-12-01 21:13:21 +04; 32min ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 4272 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
  Process: 4193 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR
  Process: 4185 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 4176 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
 Main PID: 4272 (code=exited, status=1/FAILURE)
   Status: "MariaDB server is down"

Dec 01 21:13:15 1004gourmet.com systemd[1]: Starting MariaDB 10.3.18 database server...
Dec 01 21:13:15 1004gourmet.com mysqld[4272]: 2019-12-01 21:13:15 0 [Note] /usr/sbin/mysqld (mysqld 10.3.18-MariaDB-1:10.3.18+maria~bionic) starting as process 4272 ...
Dec 01 21:13:21 1004gourmet.com systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Dec 01 21:13:21 1004gourmet.com systemd[1]: mariadb.service: Failed with result 'exit-code'.
Dec 01 21:13:21 1004gourmet.com systemd[1]: Failed to start MariaDB 10.3.18 database server.

I also forgot the root password of mysql to take backup of database, when i try to change the root password in safemode sql is shows below error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
2 Answers

Hi @web1004 ,

It seems like a DB issue, have you tried to start the mariadb yet? What about disk status, is it full?

You can find the default SQL root password file path from SSH welcome banner.

You can still send a support request to support@litespeedtech.com for a quick check with this post link appended.

Best,
Eric

  • Hi Eric,

    Thank you for your reply, Actually when i change the name of tc.log to tc.log.bak in /var/lib/musql folder the mysql server start running, and the status is:

    ● mariadb.service - MariaDB 10.3.18 database server
       Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset:
      Drop-In: /etc/systemd/system/mariadb.service.d
               └─migrated-from-my.cnf-settings.conf
       Active: active (running) since Mon 2019-12-02 00:45:31 +04; 1 day 8h ago
         Docs: man:mysqld(8)
               https://mariadb.com/kb/en/library/systemd/
      Process: 1674 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_STAR
      Process: 1665 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUC
      Process: 1356 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR
      Process: 1243 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START
      Process: 1133 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/ru
     Main PID: 1537 (mysqld)
       Status: "Taking your SQL requests now..."
        Tasks: 38 (limit: 4915)
       CGroup: /system.slice/mariadb.service
               └─1537 /usr/sbin/mysqld
    
    Dec 02 00:45:31 1004gourmet.com mysqld[1537]: 2019-12-02  0:45:31 0 [Note] InnoD
    Dec 02 00:45:31 1004gourmet.com mysqld[1537]: 2019-12-02  0:45:31 0 [Note] Plugi
    Dec 02 00:45:31 1004gourmet.com mysqld[1537]: 2019-12-02  0:45:31 0 [Note] Serve
    Dec 02 00:45:31 1004gourmet.com mysqld[1537]: 2019-12-02  0:45:31 0 [Note] Readi
    Dec 02 00:45:31 1004gourmet.com mysqld[1537]: 2019-12-02  0:45:31 0 [Note] Added
    lines 1-23
    ● mariadb.service - MariaDB 10.3.18 database server
       Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
      Drop-In: /etc/systemd/system/mariadb.service.d
               └─migrated-from-my.cnf-settings.conf
       Active: active (running) since Mon 2019-12-02 00:45:31 +04; 1 day 8h ago
         Docs: man:mysqld(8)
               https://mariadb.com/kb/en/library/systemd/
      Process: 1674 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exite
      Process: 1665 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
      Process: 1356 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/g
      Process: 1243 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited
      Process: 1133 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited,
     Main PID: 1537 (mysqld)
       Status: "Taking your SQL requests now..."
        Tasks: 38 (limit: 4915)
       CGroup: /system.slice/mariadb.service
               └─1537 /usr/sbin/mysqld
    
    Dec 02 00:45:31 1004gourmet.com mysqld[1537]: 2019-12-02  0:45:31 0 [Note] InnoDB: Loading buffer pool
    Dec 02 00:45:31 1004gourmet.com mysqld[1537]: 2019-12-02  0:45:31 0 [Note] Plugin 'FEEDBACK' is disabl
    Dec 02 00:45:31 1004gourmet.com mysqld[1537]: 2019-12-02  0:45:31 0 [Note] Server socket created on IP
    Dec 02 00:45:31 1004gourmet.com mysqld[1537]: 2019-12-02  0:45:31 0 [Note] Reading of all Master_info
    Dec 02 00:45:31 1004gourmet.com mysqld[1537]: 2019-12-02  0:45:31 0 [Note] Added new Master_info '' to
    lines 1-23
    ● mariadb.service - MariaDB 10.3.18 database server
       Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
      Drop-In: /etc/systemd/system/mariadb.service.d
               └─migrated-from-my.cnf-settings.conf
       Active: active (running) since Mon 2019-12-02 00:45:31 +04; 1 day 8h ago
         Docs: man:mysqld(8)
               https://mariadb.com/kb/en/library/systemd/
      Process: 1674 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
      Process: 1665 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
      Process: 1356 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && syste
      Process: 1243 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
      Process: 1133 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
     Main PID: 1537 (mysqld)
       Status: "Taking your SQL requests now..."
        Tasks: 38 (limit: 4915)
       CGroup: /system.slice/mariadb.service
               └─1537 /usr/sbin/mysqld
    
    Dec 02 00:45:31 1004gourmet.com mysqld[1537]: 2019-12-02  0:45:31 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
    Dec 02 00:45:31 1004gourmet.com mysqld[1537]: 2019-12-02  0:45:31 0 [Note] Plugin 'FEEDBACK' is disabled.
    Dec 02 00:45:31 1004gourmet.com mysqld[1537]: 2019-12-02  0:45:31 0 [Note] Server socket created on IP: '127.0.0.1'.
    Dec 02 00:45:31 1004gourmet.com mysqld[1537]: 2019-12-02  0:45:31 0 [Note] Reading of all Master_info entries succeeded
    Dec 02 00:45:31 1004gourmet.com mysqld[1537]: 2019-12-02  0:45:31 0 [Note] Added new Master_info '' to hash table
    
    

    and before i have disk space of 100gb SSD. But now i upgrade the diskspace as well. 320gb ssd package.

    System Status:
    Load : 2.93, 2.86, 2.61
    CPU : 30.3657%
    RAM : 1667/16040MB (10.39%)
    Disk : 111/310GB (36%)

    I don’t know why diskspace increasing day by day very fastly.

    Regards
    Mubi

Hi,

Just an update for anyone who may be interested.:
The disk increasing issue was due to unusually large log files under /var/log/journal/ which can be fixed by following this post.
And cache files under /usr/local/lsws/cachedata. In general you shouldn’t need to worry about it, cache file will still be recreated once purged/expired. So it’s possible happens when you have bunch of items. In this case, if you don’t have enough disk space, then you will want to use cronjob method to cleanup to release the disk space temporary.
FYI. auto cleanup expired cache data is on dev’s to-do.

The DB corrupt issue, happens because sometimes tc.log may be genreated in a crash, and the DB is recovered after you removed it. It’s not exactly our area of expertise unfortunately.

Best,
Eric

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!