Discover Centmin Mod today
Register Now

MariaDB All database Connection refused

Discussion in 'Install & Upgrades or Pre-Install Questions' started by Max, Aug 4, 2018.

Tags:
  1. Max

    Max Member

    62
    4
    8
    Feb 17, 2018
    Ratings:
    +6
    Local Time:
    1:08 AM
    Hello

    after my vps space full. All my database wodpresss or matomo lost

    SQLSTATE[HY000] [2002] Connection refused
    Cannot connect to the database
    Fehler beim Aufbau einer Datenbankverbindung

    Code:
    mysql -v
    
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")
    Code:
    df -h
    Dateisystem    Größe Benutzt Verf. Verw% Eingehängt auf
    /dev/vda1        41G     33G  5,8G   85% /
    devtmpfs        909M       0  909M    0% /dev
    tmpfs           920M       0  920M    0% /dev/shm
    tmpfs           920M    8,5M  911M    1% /run
    tmpfs           920M       0  920M    0% /sys/fs/cgroup
    /dev/loop0      5,8G     26M  5,5G    1% /tmp
    tmpfs           184M       0  184M    0% /run/user/0
    
    How can i fix.

    Thank you in advance for your efforts.

    regards


    Please fill in any relevant information that applies to you:

    CentOS Version: CentOS 7 64bit
    Centmin Mod Version Installed: 123.09beta01
    Nginx Version Installed: 1.15.1
    PHP Version Installed: 7.2.5
    When was last time updated Centmin Mod code base ? : 31.08.2018
    Persistent Config:
    LETSENCRYPT_DETECT='y'
    LIBRESSL_SWITCH='y'
    LIBRESSL_VERSION='2.7.4'
    NGINX_GEOIPTWOLITE='y'
    NGXDYNAMIC_GEOIPTWOLITE='y'
     
  2. wmtech

    wmtech Member

    64
    17
    8
    Jul 22, 2017
    Ratings:
    +39
    Local Time:
    2:08 AM
    restart the server?
     
    • Agree Agree x 1
  3. eva2000

    eva2000 Administrator Staff Member

    35,645
    7,847
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,101
    Local Time:
    10:08 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Yeah try rebooting server
     
  4. Max

    Max Member

    62
    4
    8
    Feb 17, 2018
    Ratings:
    +6
    Local Time:
    1:08 AM
    reboot
    Code:
    mysql -v
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")
    
    vps control restart
    Code:
     mysql -v
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")
    
    allways no connections


    systemctl start mariadb

    Code:
    systemctl stop mariadb
    [13:12][[email protected] ~]# systemctl start mariadb
    Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
    [13:12][[email protected] ~]# journalctl -xe
    Aug 04 13:12:45 happy.icoore.com mysqld[2181]: 2018-08-04 13:12:45 139683065833728 [Note] InnoDB: Waiting for purge to start
    Aug 04 13:12:45 happy.icoore.com mysqld[2181]: 2018-08-04 13:12:45 139683065833728 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.39-83.1 started; log sequence number 815613315
    Aug 04 13:12:45 happy.icoore.com mysqld[2181]: 2018-08-04 13:12:45 139683065833728 [Note] Plugin 'FEEDBACK' is disabled.
    Aug 04 13:12:45 happy.icoore.com mysqld[2181]: 2018-08-04 13:12:45 139683065833728 [ERROR] Aria engine is not enabled or did not start. The Aria engine must be enabled to continue as mysqld was
    Aug 04 13:12:45 happy.icoore.com mysqld[2181]: 2018-08-04 13:12:45 139683065833728 [ERROR] Aborting
    Aug 04 13:12:45 happy.icoore.com kernel: Firewall: *UDP_IN Blocked* IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:16:3c:b3:e4:b1:08:00 SRC=185.52.3.226 DST=255.255.255.255 LEN=201 TOS=0x00 PREC=0x00 TTL
    Aug 04 13:12:46 happy.icoore.com kernel: Firewall: *UDP_IN Blocked* IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:16:3c:b3:e4:b1:08:00 SRC=185.52.3.226 DST=255.255.255.255 LEN=201 TOS=0x00 PREC=0x00 TTL
    Aug 04 13:12:47 happy.icoore.com kernel: Firewall: *UDP_IN Blocked* IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:16:3c:a1:60:e5:08:00 SRC=81.4.126.133 DST=255.255.255.255 LEN=173 TOS=0x00 PREC=0x00 TTL
    Aug 04 13:12:47 happy.icoore.com systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
    Aug 04 13:12:47 happy.icoore.com systemd[1]: Failed to start MariaDB 10.1.34 database server.
    -- Subject: Unit mariadb.service has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit mariadb.service has failed.
    --
    -- The result is failed.
    Aug 04 13:12:47 happy.icoore.com systemd[1]: Unit mariadb.service entered failed state.
    Aug 04 13:12:47 happy.icoore.com systemd[1]: mariadb.service failed.
    Aug 04 13:12:47 happy.icoore.com polkitd[519]: Unregistered Authentication Agent for unix-process:1942:21516 (system bus name :1.31, object path /org/freedesktop/PolicyKit1/AuthenticationAgent,
    Aug 04 13:12:48 happy.icoore.com kernel: Firewall: *TCP_IN Blocked* IN=eth0 OUT= MAC=00:16:3c:4e:6a:3d:00:24:38:9b:52:00:08:00 SRC=5.189.226.178 DST=176.56.236.208 LEN=40 TOS=0x00 PREC=0x00 TTL=
    Aug 04 13:12:48 happy.icoore.com kernel: Firewall: *TCP_IN Blocked* IN=eth0 OUT= MAC=00:16:3c:4e:6a:3d:00:24:38:9b:52:00:08:00 SRC=51.15.12.240 DST=176.56.236.208 LEN=40 TOS=0x18 PREC=0x20 TTL=2
    Aug 04 13:12:49 happy.icoore.com kernel: Firewall: *UDP_IN Blocked* IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:16:3c:07:37:71:08:00 SRC=185.52.1.186 DST=255.255.255.255 LEN=114 TOS=0x00 PREC=0x00 TTL
    Aug 04 13:12:51 happy.icoore.com kernel: Firewall: *TCP_IN Blocked* IN=eth0 OUT= MAC=00:16:3c:4e:6a:3d:00:24:38:9b:52:00:08:00 SRC=45.227.255.55 DST=176.56.236.208 LEN=40 TOS=0x00 PREC=0x00 TTL=
    Aug 04 13:12:52 happy.icoore.com kernel: Firewall: *TCP_IN Blocked* IN=eth0 OUT= MAC=00:16:3c:4e:6a:3d:00:24:38:9b:52:00:08:00 SRC=81.196.199.180 DST=176.56.236.208 LEN=40 TOS=0x00 PREC=0x00 TTL
    Aug 04 13:12:53 happy.icoore.com kernel: Firewall: *UDP_IN Blocked* IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:16:3c:d8:49:be:08:00 SRC=185.52.3.218 DST=255.255.255.255 LEN=171 TOS=0x00 PREC=0x00 TTL
    Aug 04 13:12:55 happy.icoore.com kernel: Firewall: *UDP_IN Blocked* IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:16:3c:ed:d1:7a:08:00 SRC=176.56.236.107 DST=255.255.255.255 LEN=116 TOS=0x00 PREC=0x00 T
    Aug 04 13:12:55 happy.icoore.com kernel: Firewall: *TCP_IN Blocked* IN=eth0 OUT= MAC=00:16:3c:4e:6a:3d:00:24:38:9b:52:00:08:00 SRC=108.178.185.226 DST=81.4.124.134 LEN=52 TOS=0x00 PREC=0x20 TTL=
    Aug 04 13:12:57 happy.icoore.com kernel: Firewall: *TCP_IN Blocked* IN=eth0 OUT= MAC=00:16:3c:4e:6a:3d:00:24:38:9b:52:00:08:00 SRC=119.28.77.163 DST=176.56.236.90 LEN=40 TOS=0x08 PREC=0x60 TTL=2
    Aug 04 13:12:58 happy.icoore.com kernel: Firewall: *UDP_IN Blocked* IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:16:3c:2e:39:45:08:00 SRC=81.4.122.174 DST=255.255.255.255 LEN=267 TOS=0x00 PREC=0x00 TTL
    Aug 04 13:12:58 happy.icoore.com kernel: Firewall: *TCP_IN Blocked* IN=eth0 OUT= MAC=00:16:3c:4e:6a:3d:00:24:38:9b:52:00:08:00 SRC=108.178.185.226 DST=81.4.124.134 LEN=52 TOS=0x00 PREC=0x20 TTL=
    Aug 04 13:12:58 happy.icoore.com kernel: Firewall: *UDP_IN Blocked* IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:16:3c:5c:09:d5:08:00 SRC=81.4.101.2 DST=255.255.255.255 LEN=173 TOS=0x00 PREC=0x00 TTL=6
    Aug 04 13:12:59 happy.icoore.com kernel: Firewall: *UDP_IN Blocked* IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:16:3c:e1:bc:c3:08:00 SRC=81.4.101.227 DST=255.255.255.255 LEN=68 TOS=0x00 PREC=0x00 TTL=
    Aug 04 13:12:59 happy.icoore.com sshd[2203]: Connection closed by 140.143.5.174 port 3594 [preauth]
    Aug 04 13:13:01 happy.icoore.com systemd[1]: Started Session 7 of user root.
    -- Subject: Unit session-7.scope has finished start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit session-7.scope has finished starting up.
    --
    -- The start-up result is done.
    Aug 04 13:13:01 happy.icoore.com systemd[1]: Starting Session 7 of user root.
    -- Subject: Unit session-7.scope has begun start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit session-7.scope has begun starting up.
    Aug 04 13:13:01 happy.icoore.com CROND[2225]: (root) CMD (curl -s -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64)" https://rvlove.co/wp-cron.php?doing_wp_cron)
    Aug 04 13:13:01 happy.icoore.com postfix/pickup[1424]: 56B6E7F99C: uid=0 from=<root>
    Aug 04 13:13:01 happy.icoore.com postfix/cleanup[1739]: 56B6E7F99C: message-id=<[email protected]>
    Aug 04 13:13:01 happy.icoore.com postfix/qmgr[1425]: 56B6E7F99C: from=<[email protected]>, size=1031, nrcpt=1 (queue active)
    Aug 04 13:13:01 happy.icoore.com postfix/local[1744]: 56B6E7F99C: to=<[email protected]>, orig_to=<root>, relay=local, delay=0, delays=0/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
    Aug 04 13:13:01 happy.icoore.com postfix/qmgr[1425]: 56B6E7F99C: removed
    lines 2417-2470/2470 (END)
    
     
  5. eva2000

    eva2000 Administrator Staff Member

    35,645
    7,847
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,101
    Local Time:
    10:08 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Centmin Mod is provide as is, so short of scripted related bugs or issues, any further optimisation to the web stack components - nginx, php-fpm, mariadb mysql, csf firewall etc or web app specific configurations are left to the Centmin Mod user to deal with. So I do not provide any free support for such troubleshooting Mariadb issues.

    However, Centmin Mod users are free to help each other out and ask questions or give answers on this community forum. My hopes are that this community forum evolves so that more veteran long time Centmin Mod users help new Centmin Mod users out :)

    With that said you need to dig into MariaDB mysql error logs and on centos 7 it's via journalctl i.e. list last 500 lines via tail for mariadb user and use sed to filter and mask hostname.
    Code (Text):
    journalctl -u mariadb --no-pager | sed -e "s|$(hostname)|hostname|g" | tail -500
    

    Then maybe adjust tail command for further back i.e. last 1000 lines tail -1000 if need to dig deeper. I wouldn't post the info on forums maybe pastebin.com or gist.github.com and dig into error messages and search or hire someone to fix the issue. Troubleshooting MySQL issues due to disk space full issues can be tricky as it could cause data corruption so need MySQL data corruption repair/recover and/or restore from most recent backup if repair/recovery is not possible depending on how bad the issue is.

    example output for good condition server
    Code (Text):
    journalctl -u mariadb --no-pager | sed -e "s|$(hostname)|hostname|g" | tail -500   
    -- Logs begin at Tue 2018-06-19 20:35:13 UTC, end at Sat 2018-08-04 13:18:29 UTC. --
    Jun 19 20:35:53 hostname systemd[1]: Starting MariaDB 10.1.34 database server...
    Jun 19 20:35:54 hostname mysqld[2115]: 2018-06-19 20:35:54 139997328140544 [Note] /usr/sbin/mysqld (mysqld 10.1.34-MariaDB) starting as process 2115 ...
    Jun 19 20:35:54 hostname mysqld[2115]: 2018-06-19 20:35:54 139997328140544 [Note] InnoDB: Using mutexes to ref count buffer pool pages
    Jun 19 20:35:54 hostname mysqld[2115]: 2018-06-19 20:35:54 139997328140544 [Note] InnoDB: The InnoDB memory heap is disabled
    Jun 19 20:35:54 hostname mysqld[2115]: 2018-06-19 20:35:54 139997328140544 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
    Jun 19 20:35:54 hostname mysqld[2115]: 2018-06-19 20:35:54 139997328140544 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
    Jun 19 20:35:54 hostname mysqld[2115]: 2018-06-19 20:35:54 139997328140544 [Note] InnoDB: Compressed tables use zlib 1.2.7
    Jun 19 20:35:54 hostname mysqld[2115]: 2018-06-19 20:35:54 139997328140544 [Note] InnoDB: Using Linux native AIO
    Jun 19 20:35:54 hostname mysqld[2115]: 2018-06-19 20:35:54 139997328140544 [Note] InnoDB: Using SSE crc32 instructions
    Jun 19 20:35:54 hostname mysqld[2115]: 2018-06-19 20:35:54 139997328140544 [Note] InnoDB: Initializing buffer pool, size = 8.0G
    Jun 19 20:35:54 hostname mysqld[2115]: 2018-06-19 20:35:54 139997328140544 [Note] InnoDB: Completed initialization of buffer pool
    Jun 19 20:35:54 hostname mysqld[2115]: 2018-06-19 20:35:54 139997328140544 [Note] InnoDB: Highest supported file format is Barracuda.
    Jun 19 20:35:54 hostname mysqld[2115]: 2018-06-19 20:35:54 139997328140544 [Note] InnoDB: 128 rollback segment(s) are active.
    Jun 19 20:35:54 hostname mysqld[2115]: 2018-06-19 20:35:54 139997328140544 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.39-83.1 started; log sequence number 28117116776
    Jun 19 20:35:54 hostname mysqld[2115]: 2018-06-19 20:35:54 139985470617344 [Note] InnoDB: Dumping buffer pool(s) not yet started
    Jun 19 20:35:54 hostname mysqld[2115]: 2018-06-19 20:35:54 139997328140544 [Note] Plugin 'FEEDBACK' is disabled.
    Jun 19 20:35:54 hostname mysqld[2115]: 2018-06-19 20:35:54 139997328140544 [Note] Server socket created on IP: '::'.
    Jun 19 20:35:54 hostname mysqld[2115]: 2018-06-19 20:35:54 139997328140544 [Note] /usr/sbin/mysqld: ready for connections.
    Jun 19 20:35:54 hostname mysqld[2115]: Version: '10.1.34-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
    Jun 19 20:35:54 hostname systemd[1]: Started MariaDB 10.1.34 database server.
    
     
  6. Max

    Max Member

    62
    4
    8
    Feb 17, 2018
    Ratings:
    +6
    Local Time:
    1:08 AM
    Hello

    i erase all logfiles in /var/lib/mysql/* and mysqld works :)
     
  7. eva2000

    eva2000 Administrator Staff Member

    35,645
    7,847
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,101
    Local Time:
    10:08 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    from limited error log info you provided, you only needed to delete aria_log_control but without knowing of other errors, deleting mysql/innodb logs improperly can also cause more potential corruption down the road. MySQL starting up doesn't necessarily mean all is ok - future corruption may result due to improper log removal. So be careful as you should properly investigate the log errors to determine the extent of the issues.
     
..