Ad Widget

Collapse

Database error: No such file or directory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • islam
    Junior Member
    • Apr 2024
    • 19

    #1

    Database error: No such file or directory

    Hello,
    I am trying to open zabbix after kernel update using (apt update && apt upgrade) on ubuntu 20.04
    the status of the database using (service mariadb status) is inactive error picture is in link https://prnt.sc/pIYZtN0d1G4p.

    Code:
    root@ubuntu:~# mysql -h localhost -u user database
    ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2)
    root@ubuntu:~# netstat -tuln | grep 3306
    root@ubuntu:~# service mariadb status
    ○ mariadb.service - MariaDB 10.6.16 database server
         Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
         Active: inactive (dead) since Thu 2024-05-09 17:05:51 UTC; 46min ago
           Docs: man:mariadbd(8)
                 https://mariadb.com/kb/en/library/systemd/
       Main PID: 77813 (code=exited, status=0/SUCCESS)
         Status: "MariaDB server is down"
            CPU: 13.238s
    
    May 09 17:05:51 ubuntu mariadbd[77813]: 2024-05-09 17:05:51 0 [Note] InnoDB: Starting shutdown...
    May 09 17:05:51 ubuntu mariadbd[77813]: 2024-05-09 17:05:51 0 [Note] InnoDB: Dumping buffer pool(s) to /var>
    May 09 17:05:51 ubuntu mariadbd[77813]: 2024-05-09 17:05:51 0 [Note] InnoDB: Restricted to 2028 pages due t>
    May 09 17:05:51 ubuntu mariadbd[77813]: 2024-05-09 17:05:51 0 [Note] InnoDB: Buffer pool(s) dump completed >
    May 09 17:05:51 ubuntu mariadbd[77813]: 2024-05-09 17:05:51 0 [Note] InnoDB: Removed temporary tablespace d>
    May 09 17:05:51 ubuntu mariadbd[77813]: 2024-05-09 17:05:51 0 [Note] InnoDB: Shutdown completed; log sequen>
    May 09 17:05:51 ubuntu mariadbd[77813]: 2024-05-09 17:05:51 0 [Note] /usr/sbin/mariadbd: Shutdown complete
    May 09 17:05:51 ubuntu systemd[1]: mariadb.service: Deactivated successfully.
    May 09 17:05:51 ubuntu systemd[1]: Stopped MariaDB 10.6.16 database server.
    May 09 17:05:51 ubuntu systemd[1]: mariadb.service: Consumed 13.238s CPU time.

    I tried to listen to port using (netstat -tuln | grep 3306)
    but no result
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    Originally posted by islam
    Status: "MariaDB server is down"

    May 09 17:05:51 ubuntu mariadbd[77813]: 2024-05-09 17:05:51 0 [Note] InnoDB: Starting shutdown...

    May 09 17:05:51 ubuntu mariadbd[77813]: 2024-05-09 17:05:51 0 [Note] /usr/sbin/mariadbd: Shutdown complete
    Those messages you displayed mean your database has shut down.

    If it was a normal database shutdown and there are no problems, you just need to start up the mariadb service.

    You should look at the MariaDB logs, probably /var/log/mariadb.log or /var/log/mariadb/error.log or something similar, and see if there were any problems that caused the database to shut down. If there were problems, you need to research the problem and fix it, and then restart the database.

    Comment

    • islam
      Junior Member
      • Apr 2024
      • 19

      #3
      I can't find the log file in location you said https://prnt.sc/xTxqJRZgbdyY you can check the picture even mysql file is empty

      Comment

      • toj
        Junior Member
        • Oct 2023
        • 8

        #4
        If mariadb is not running then start it with "sudo systemctl start mariadb.service"
        and if it fails then check the status/logs with "sudo journalctl -u mariadb.service"

        Comment

        • islam
          Junior Member
          • Apr 2024
          • 19

          #5
          when I use (systemctl start mariadb.service) it take long time no message showing and no error

          Comment

          • toj
            Junior Member
            • Oct 2023
            • 8

            #6
            is mariadb running?, what does "systemctl status mariadb.service" tell you.

            Comment

            • tim.mooney
              Senior Member
              • Dec 2012
              • 1427

              #7
              Originally posted by islam
              I can't find the log file in location you said https://prnt.sc/xTxqJRZgbdyY you can check the picture even mysql file is empty
              Ubuntu apparently uses /var/log/mysql/ as the potential directory for MariaDB logs, rather than /var/log/mariadb/

              I had assumed that error logging would be enabled for MariaDB, but perhaps Ubuntu doesn't default to enabling it. You may want to investigate whether your site should set 'log-error' and what level you want to use for 'log-warnings'. See the MariaDB documentation for your version of MariaDB to understand what those two settings do.

              The benefit of having the error log is that it would contain any log messages that MariaDB output before it shut down. Since logging apparently isn't enabled, those messages are lost. Focusing on starting mariadb.service and using "systemctl status -l mariadb.service | less" and "journalctl" to get access to any systemd messages from mariadb may be your best bet for discovering if there is a problem.

              Comment

              • cyber
                Senior Member
                Zabbix Certified SpecialistZabbix Certified Professional
                • Dec 2006
                • 4807

                #8
                As status query in first post shows some loglines, It probably logs to journal or something... so as toj already suggested "sudo journalctl -u mariadb.service" should show something... Possibly more than in this short snippet in status message...

                Comment

                Working...