I can't connect to database. Where are mysql logs?

Discussion in 'General' started by Planea, Jun 8, 2024.

  1. Planea

    Planea New Member

    Hi,
    I'm trying to install a new WordPress on a client account.
    When I enter the database access data to complete the installation I get the message that a connection to the database cannot be established despite doing it as I have always done it
    I have changed the password, created and destroyed the database several times but I keep getting the same error.
    Where are the MySql logs located to see what is going on? I can't find them.
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    That depends on the Operating System and logging settings. You should say what OS you have.
    If the logs are not in /var/log/mysql/, I guess you are running Debian 12. If so, you can see logs with
    Code:
    journalctl --unit=mariadb.service
    If this does not help, provide more info, or follow
    https://forum.howtoforge.com/threads/please-read-before-posting.58408/
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Just a guess, did you change the MySQL root password without setting the new MySQL root password in /usr/local/ispconfig/server/lib/mysql_clientdb.conf file?
     
    Planea likes this.
  4. Planea

    Planea New Member

    I'm working with Debian 11.
    When I execute:
    Code:
    journalctl --unit=mariadb.service
    I receive so much information but two messages focus my attention:
    Code:
    Jun 09 22:20:04 isp01 mariadbd[401929]: 2024-06-09 22:20:04 180954 [ERROR] mariadbd: Disk full (/tmp/#sql-temptable-62209-2c2da-19e2.MAI); waiting for someone to free some space... (errno: 28 "No space left on>
    and
    Code:
    Jun 10 00:01:51 isp01 mariadbd[401929]: 2024-06-10  0:01:51 210631 [Warning] Aborted connection 210631 to db: 'dbispconfig' user: 'ispconfig' host: 'localhost' (Got an error writing communication packets)
    
    When I execute df -h
    Code:
    # df -h
    Filesystem                                 Size  Used Avail Use% Mounted on
    udev                                       3.9G     0  3.9G   0% /dev
    tmpfs                                      795M  760K  794M   1% /run
    /dev/mapper/ispconfig01--vg-root            22G  2.6G   19G  13% /
    tmpfs                                      3.9G   64K  3.9G   1% /dev/shm
    tmpfs                                      5.0M     0  5.0M   0% /run/lock
    /dev/sda1                                  470M   87M  359M  20% /boot
    /dev/mapper/ispconfig01--vg-home           2.0G  768M  1.1G  42% /home
    /dev/mapper/ispconfig01--vg-tmp            1.4G  240K  1.3G   1% /tmp
    /dev/mapper/ispconfig01--vg-var             92G   83G  4.5G  95% /var
    
    Need I more space in my temporary unit? how much might be required, or is this an underlying problem?


    HTF REPORT:
    Code:
    ##### SERVER #####
    IP-address (as per hostname): ***.***.***.***
    [WARN] could not determine server's ip address by ifconfig
    [INFO] OS version is Debian GNU/Linux 11 (bullseye)
     
    [INFO] uptime:  12:49:41 up 2 days,  2:32,  1 user,  load average: 0.22, 0.35, 0.72
     
    [INFO] memory:
                   total        used        free      shared  buff/cache   available
    Mem:           7.8Gi       3.7Gi       1.3Gi       329Mi       2.8Gi       3.5Gi
    Swap:          975Mi       536Mi       439Mi
     
    [INFO] systemd failed services status:
      UNIT           LOAD   ACTIVE SUB    DESCRIPTION
    ● maldet.service loaded failed failed Linux Malware Detect monitoring - maldet
    
    LOAD   = Reflects whether the unit definition was properly loaded.
    ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
    SUB    = The low-level unit activation state, values depend on unit type.
    1 loaded units listed.
    
    [INFO] ISPConfig is installed.
    
    ##### ISPCONFIG #####
    ISPConfig version is 3.2.11p2
    
    
    ##### VERSION CHECK #####
    
    [INFO] php (cli) version is 7.4.33
    [INFO] php-cgi (used for cgi php in default vhost!) is version 7.4.33
    
    ##### PORT CHECK #####
    
    
    ##### MAIL SERVER CHECK #####
    
    
    ##### RUNNING SERVER PROCESSES #####
    
    [INFO] I found the following web server(s):
        Apache 2 (PID 648357)
    [INFO] I found the following mail server(s):
        Postfix (PID 649151)
    [INFO] I found the following pop3 server(s):
        Dovecot (PID 649159)
    [INFO] I found the following imap server(s):
        Dovecot (PID 649159)
    [INFO] I found the following ftp server(s):
        PureFTP (PID 1174)
    
    ##### LISTENING PORTS #####
    (only        ()
    Local        (Address)
    [anywhere]:587        (649151/master)
    [localhost]:6379        (616/redis-server)
    [localhost]:11211        (607/memcached)
    [anywhere]:110        (649159/dovecot)
    [anywhere]:143        (649159/dovecot)
    [anywhere]:465        (649151/master)
    [anywhere]:21        (1174/pure-ftpd)
    ***.***.***.***:53        (608/named)
    ***.***.***.***:53        (608/named)
    ***.***.***.***:53        (608/named)
    ***.***.***.***:53        (608/named)
    [localhost]:53        (608/named)
    [localhost]:53        (608/named)
    [localhost]:53        (608/named)
    [localhost]:53        (608/named)
    [anywhere]:22        (632/sshd:)
    [anywhere]:25        (649151/master)
    [localhost]:953        (608/named)
    [anywhere]:4190        (649159/dovecot)
    [anywhere]:993        (649159/dovecot)
    [anywhere]:995        (649159/dovecot)
    [localhost]:11332        (617/rspamd:)
    [localhost]:11333        (617/rspamd:)
    [localhost]:11334        (617/rspamd:)
    [localhost]:10023        (1255/postgrey)
    *:*:*:*::*:3306        (652927/mariadbd)
    *:*:*:*::*:587        (649151/master)
    *:*:*:*::*:6379        (616/redis-server)
    [localhost]10        (649159/dovecot)
    [localhost]43        (649159/dovecot)
    *:*:*:*::*:8080        (648357/apache2)
    *:*:*:*::*:80        (648357/apache2)
    *:*:*:*::*:465        (649151/master)
    *:*:*:*::*:8081        (648357/apache2)
    *:*:*:*::*:21        (1174/pure-ftpd)
    *:*:*:*::*:22        (632/sshd:)
    *:*:*:*::*:25        (649151/master)
    *:*:*:*::*:443        (648357/apache2)
    *:*:*:*::*:4190        (649159/dovecot)
    *:*:*:*::*:993        (649159/dovecot)
    *:*:*:*::*:995        (649159/dovecot)
    *:*:*:*::*:11332        (617/rspamd:)
    *:*:*:*::*:11333        (617/rspamd:)
    *:*:*:*::*:11334        (617/rspamd:)
    *:*:*:*::*:10023        (1255/postgrey)
    
    
    
    
    ##### IPTABLES #####
    Chain INPUT (policy DROP)
    target     prot opt source               destination         
    f2b-dovecot  tcp  --  [anywhere]/0            [anywhere]/0            multiport dports 110,995,143,993,587,465,4190
    f2b-sshd   tcp  --  [anywhere]/0            [anywhere]/0            multiport dports 22
    f2b-postfix-sasl  tcp  --  [anywhere]/0            [anywhere]/0            multiport dports 25
    ufw-before-logging-input  all  --  [anywhere]/0            [anywhere]/0           
    ufw-before-input  all  --  [anywhere]/0            [anywhere]/0           
    ufw-after-input  all  --  [anywhere]/0            [anywhere]/0           
    ufw-after-logging-input  all  --  [anywhere]/0            [anywhere]/0           
    ufw-reject-input  all  --  [anywhere]/0            [anywhere]/0           
    ufw-track-input  all  --  [anywhere]/0            [anywhere]/0           
    
    Chain FORWARD (policy DROP)
    target     prot opt source               destination         
    ufw-before-logging-forward  all  --  [anywhere]/0            [anywhere]/0           
    ufw-before-forward  all  --  [anywhere]/0            [anywhere]/0           
    ufw-after-forward  all  --  [anywhere]/0            [anywhere]/0           
    ufw-after-logging-forward  all  --  [anywhere]/0            [anywhere]/0           
    ufw-reject-forward  all  --  [anywhere]/0            [anywhere]/0           
    ufw-track-forward  all  --  [anywhere]/0            [anywhere]/0           
    
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination         
    ufw-before-logging-output  all  --  [anywhere]/0            [anywhere]/0           
    ufw-before-output  all  --  [anywhere]/0            [anywhere]/0           
    ufw-after-output  all  --  [anywhere]/0            [anywhere]/0           
    ufw-after-logging-output  all  --  [anywhere]/0            [anywhere]/0           
    ufw-reject-output  all  --  [anywhere]/0            [anywhere]/0           
    ufw-track-output  all  --  [anywhere]/0            [anywhere]/0           
    
    Chain f2b-dovecot (1 references)
    target     prot opt source               destination         
    RETURN     all  --  [anywhere]/0            [anywhere]/0           
    
    Chain f2b-postfix-sasl (1 references)
    target     prot opt source               destination         
    RETURN     all  --  [anywhere]/0            [anywhere]/0           
    
    Chain f2b-sshd (1 references)
    target     prot opt source               destination         
    REJECT     all  --  ***.***.***.***       [anywhere]/0            reject-with icmp-port-unreachable
    RETURN     all  --  [anywhere]/0            [anywhere]/0           
    
    Chain ufw-after-forward (1 references)
    target     prot opt source               destination         
    
    Chain ufw-after-input (1 references)
    target     prot opt source               destination         
    ufw-skip-to-policy-input  udp  --  [anywhere]/0            [anywhere]/0            udp dpt:137
    ufw-skip-to-policy-input  udp  --  [anywhere]/0            [anywhere]/0            udp dpt:138
    ufw-skip-to-policy-input  tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:139
    ufw-skip-to-policy-input  tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:445
    ufw-skip-to-policy-input  udp  --  [anywhere]/0            [anywhere]/0            udp dpt:67
    ufw-skip-to-policy-input  udp  --  [anywhere]/0            [anywhere]/0            udp dpt:68
    ufw-skip-to-policy-input  all  --  [anywhere]/0            [anywhere]/0            ADDRTYPE match dst-type BROADCAST
    
    Chain ufw-after-logging-forward (1 references)
    target     prot opt source               destination         
    LOG        all  --  [anywhere]/0            [anywhere]/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "
    
    Chain ufw-after-logging-input (1 references)
    target     prot opt source               destination         
    LOG        all  --  [anywhere]/0            [anywhere]/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "
    
    Chain ufw-after-logging-output (1 references)
    target     prot opt source               destination         
    
    Chain ufw-after-output (1 references)
    target     prot opt source               destination         
    
    Chain ufw-before-forward (1 references)
    target     prot opt source               destination         
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0            ctstate RELATED,ESTABLISHED
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 3
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 11
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 12
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 8
    ufw-user-forward  all  --  [anywhere]/0            [anywhere]/0           
    
    Chain ufw-before-input (1 references)
    target     prot opt source               destination         
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0           
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0            ctstate RELATED,ESTABLISHED
    ufw-logging-deny  all  --  [anywhere]/0            [anywhere]/0            ctstate INVALID
    DROP       all  --  [anywhere]/0            [anywhere]/0            ctstate INVALID
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 3
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 11
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 12
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 8
    ACCEPT     udp  --  [anywhere]/0            [anywhere]/0            udp spt:67 dpt:68
    ufw-not-local  all  --  [anywhere]/0            [anywhere]/0           
    ACCEPT     udp  --  [anywhere]/0            ***.***.***.***          udp dpt:5353
    ACCEPT     udp  --  [anywhere]/0            ***.***.***.***      udp dpt:1900
    ufw-user-input  all  --  [anywhere]/0            [anywhere]/0           
    
    Chain ufw-before-logging-forward (1 references)
    target     prot opt source               destination         
    
    Chain ufw-before-logging-input (1 references)
    target     prot opt source               destination         
    
    Chain ufw-before-logging-output (1 references)
    target     prot opt source               destination         
    
    Chain ufw-before-output (1 references)
    target     prot opt source               destination         
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0           
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0            ctstate RELATED,ESTABLISHED
    ufw-user-output  all  --  [anywhere]/0            [anywhere]/0           
    
    Chain ufw-logging-allow (0 references)
    target     prot opt source               destination         
    LOG        all  --  [anywhere]/0            [anywhere]/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW ALLOW] "
    
    Chain ufw-logging-deny (2 references)
    target     prot opt source               destination         
    RETURN     all  --  [anywhere]/0            [anywhere]/0            ctstate INVALID limit: avg 3/min burst 10
    LOG        all  --  [anywhere]/0            [anywhere]/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "
    
    Chain ufw-not-local (1 references)
    target     prot opt source               destination         
    RETURN     all  --  [anywhere]/0            [anywhere]/0            ADDRTYPE match dst-type LOCAL
    RETURN     all  --  [anywhere]/0            [anywhere]/0            ADDRTYPE match dst-type MULTICAST
    RETURN     all  --  [anywhere]/0            [anywhere]/0            ADDRTYPE match dst-type BROADCAST
    ufw-logging-deny  all  --  [anywhere]/0            [anywhere]/0            limit: avg 3/min burst 10
    DROP       all  --  [anywhere]/0            [anywhere]/0           
    
    Chain ufw-reject-forward (1 references)
    target     prot opt source               destination         
    
    Chain ufw-reject-input (1 references)
    target     prot opt source               destination         
    
    Chain ufw-reject-output (1 references)
    target     prot opt source               destination         
    
    Chain ufw-skip-to-policy-forward (0 references)
    target     prot opt source               destination         
    DROP       all  --  [anywhere]/0            [anywhere]/0           
    
    Chain ufw-skip-to-policy-input (7 references)
    target     prot opt source               destination         
    DROP       all  --  [anywhere]/0            [anywhere]/0           
    
    Chain ufw-skip-to-policy-output (0 references)
    target     prot opt source               destination         
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0           
    
    Chain ufw-track-forward (1 references)
    target     prot opt source               destination         
    
    Chain ufw-track-input (1 references)
    target     prot opt source               destination         
    
    Chain ufw-track-output (1 references)
    target     prot opt source               destination         
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            ctstate NEW
    ACCEPT     udp  --  [anywhere]/0            [anywhere]/0            ctstate NEW
    
    Chain ufw-user-forward (1 references)
    target     prot opt source               destination         
    
    Chain ufw-user-input (1 references)
    target     prot opt source               destination         
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:21
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:22
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:25
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:53
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:80
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:110
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:143
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:443
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:465
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:587
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:993
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:995
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:3306
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:4190
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:8080
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:8081
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            multiport dports 40110:40210
    ACCEPT     udp  --  [anywhere]/0            [anywhere]/0            udp dpt:53
    ACCEPT     tcp  --  ***.***.***.***        [anywhere]/0            tcp dpt:3306
    DROP       all  --  ***.***.***.***       [anywhere]/0           
    DROP       all  --  ***.***.***.***        [anywhere]/0           
    DROP       all  --  ***.***.***.***        [anywhere]/0           
    DROP       all  --  ***.***.***.***        [anywhere]/0           
    DROP       all  --  ***.***.***.***/23     [anywhere]/0           
    DROP       all  --  ***.***.***.***/18      [anywhere]/0           
    DROP       all  --  ***.***.***.***/18      [anywhere]/0           
    DROP       all  --  ***.***.***.***/18       [anywhere]/0           
    DROP       all  --  ***.***.***.***/19      [anywhere]/0           
    DROP       all  --  ***.***.***.***/18          [anywhere]/0           
    DROP       all  --  ***.***.***.***/20        [anywhere]/0           
    DROP       all  --  ***.***.***.***       [anywhere]/0           
    DROP       all  --  ***.***.***.***        [anywhere]/0           
    
    Chain ufw-user-limit (0 references)
    target     prot opt source               destination         
    LOG        all  --  [anywhere]/0            [anywhere]/0            limit: avg 3/min burst 5 LOG flags 0 level 4 prefix "[UFW LIMIT BLOCK] "
    REJECT     all  --  [anywhere]/0            [anywhere]/0            reject-with icmp-port-unreachable
    
    Chain ufw-user-limit-accept (0 references)
    target     prot opt source               destination         
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0           
    
    Chain ufw-user-logging-forward (0 references)
    target     prot opt source               destination         
    
    Chain ufw-user-logging-input (0 references)
    target     prot opt source               destination         
    
    Chain ufw-user-logging-output (0 references)
    target     prot opt source               destination         
    
    Chain ufw-user-output (1 references)
    target     prot opt source               destination         
    
    
    
    
    ##### LET'S ENCRYPT #####
    Certbot is installed in /usr/bin/letsencrypt
    
    
    
     
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    What temporary unit?
    Code:
    /dev/mapper/ispconfig01--vg-var             92G   83G  4.5G  95% /var
    The /var partition looks full, there is probably setting of 5% reserved for root only use, so ordinary users can not fill the disk.
    Those look like volume group disks, so it should be possible to change sizes? Or clean undeeded files from the /var partition to make some space free.
    Hard to say, it depends on the use case. But Unix and Linux systems can not work if the disk is full. Estimate how much disk space you probably need in the next one or two years, and adapt partition sizes to that estimate.
     
    ztk.me likes this.
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Have you verified that the password in the file /usr/local/ispconfig/server/lib/mysql_clientdb.conf is correct? Try logging into phpmyadmin with that password and username root.

    The memory error you posted might have been a temporary thing while MySQL was performing a memory-intensive operation. I doubt that the creation of the database failed due to that, and the connection error can have many reasons and is not necessarily a problem as most services retry on disconnect, and ISPconfig does this as well.
     
  7. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    The amount of memory/space needed for your tmpfs is highly influenced by the need of temporary tables, the size of it and the amount of tasks needing the space at the same time.
    You should monitor your database usage and maybe adjust your configuration and or resize the tmpfs, may it be on disk or just a memory mount.
    when full, connections start failing

    edit: might aswell have been accumulated due to, see what @Taleman wrote
     
  8. Planea

    Planea New Member

    I have recovered some space on that partition to 92% and the problem continues.
    Code:
    /dev/mapper/ispconfig01--vg-var             92G   80G  7.7G  92% /var
    
    I was actually referring to:
    Code:
    /dev/mapper/ispconfig01--vg-tmp 1.4G 240K 1.3G 1% /tmp
    Where it looks like mariadb said it didn't have enough disk space.

    It is correct and I can access with phpmyadmin without problem.
     
  9. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    whatever you set your tmp folder to, you would have checked with du during the time it was full, hence the name, temporary files.
    They get created and unlinked ( but not deleted ) so you can see them using lsof only + the space is freed when the file is not needed anymore.
    So the tmp folder might have been full when the warning was put to the logs
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Have you checked in phpmyadmin if the user and database have been created? And if yes, can you login with the username and password you created in ISPConfig using phpmyadmin?

    Another guess: have you maybe activated php-fpm chroot in website settings and tried to use 'localhost' as the database hostname? If yes, use 127.0.0.1 as the database hostname instead; localhost can only be used when the php-fpm of the website is not in a chroot jail.
     
    Planea likes this.
  11. Planea

    Planea New Member

    Yes, this was indeed my problem.
    At some point I must have changed in System > Server config > PHP settings this option.
    I have disabled it so that it is not in the chroot jail but it still does not allow me to use localhost. Where can I change this behaviour for the website?
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    You must change this in the website settings, options tab.
     
    Planea likes this.
  13. HomTanks

    HomTanks New Member

    Yes, this was indeed my problem.
    At some point I must have changed in System > Server config > PHP settings this option.
    I have disabled it so that it is not in the chroot jail but it still does not allow me to use localhost.:(
     
    Last edited: Aug 10, 2024
  14. Planea

    Planea New Member

    You need to change it on website options too.
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, indeed. System > Server config > PHP settings is just the default for new sites.
     

Share This Page