Ad Widget

Collapse

Fresh install. Cannot connect to the database. No such file or directory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Del.Mar
    Junior Member
    • May 2022
    • 9

    #1

    Fresh install. Cannot connect to the database. No such file or directory

    Hello mates!
    On the step "Configure DB connection" I get an error with connection to DB (MySQL).
    Click image for larger version

Name:	2022-05-21_21-19-26.png
Views:	6098
Size:	30.0 KB
ID:	444943
    I've edited /etc/zabbix/zabbix_server.conf wrote user,db and password. Also add mysql socket path.
    If I try to connect via console with zabbix user, login and pass works fine.
    I don't have any errors with connection in /var/log/zabbix/zabbix_server.log
    I can't understand where find the error. Please help!
  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    #2
    Were all prerequisites met ("OK") in the previous page?

    Markku

    Comment

    • markfree
      Senior Member
      • Apr 2019
      • 868

      #3
      You are getting a Frontend error, not Server. So, you need to make sure your DB host, port, name, user and password are correctly set in this DB connection form.

      I assume you are using a standalone installation, but, if your Zabbix Frontend uses a different host than MySQL, make sure your DB and user can receive connections from different hosts.
      Last edited by markfree; 22-05-2022, 17:37.

      Comment

      • Del.Mar
        Junior Member
        • May 2022
        • 9

        #4
        Originally posted by Markku
        Were all prerequisites met ("OK") in the previous page?
        Markku
        Yes!
        Originally posted by markfree
        You are getting a Frontend error, not Server. So, you need to make sure your DB host, port, name, user and password are correctly set in this DB connection form.
        I assume you are using a standalone installation, but, if your Zabbix Frontend uses a different host than MySQL, make sure your DB and user can receive connections from different hosts.
        I couldn't figure out if it was a front or back error. There was nothing in the logs, even with zabbix extended debugging enabled. All database settings were made correctly and I could connect directly to the database in the console. The database was also created and imported during the initial installation.
        I've found solution. The problem was in php.ini config file with path to mysql socket. I changed today path to
        Code:
        mysqli.default_socket = /var/lib/mysql/mysql.sock
        from
        Code:
        mysqli.default_socket = /run/mysql.sock
        And finish installation.
        Thanks for help.

        Comment

        • habibsalhi
          Junior Member
          • Jun 2022
          • 4

          #5
          dears

          After adding DBSocket= /run/mysql.sock to /etc/zabbix/zabbix_server.conf file the zabbix-server.service is active but still the same error appear;
          and I restart the httpd and PHP and restart also the server but not solving the problem ??
          if there is any solutions?

          Comment

          • vladimir_lv
            Senior Member
            • May 2022
            • 240

            #6
            Originally posted by habibsalhi
            dears

            After adding DBSocket= /run/mysql.sock to /etc/zabbix/zabbix_server.conf file the zabbix-server.service is active but still the same error appear;
            and I restart the httpd and PHP and restart also the server but not solving the problem ??
            if there is any solutions?
            Are you sure that you had used the correct path to sock fille?
            Just check the path:
            find / -name "mysql.sock"

            Comment

            • tim.mooney
              Senior Member
              • Dec 2012
              • 1427

              #7
              Originally posted by habibsalhi
              After adding DBSocket= /run/mysql.sock to /etc/zabbix/zabbix_server.conf file the zabbix-server.service is active but still the same error appear;
              and I restart the httpd and PHP and restart also the server but not solving the problem ??
              The Zabbix web interface (the "front end") is a separate application from the Zabbix server. In large installations, the web front end may be installed on a completely separate server from the zabbix-server package(s).

              Because they are separate applications, each application has a separate configuration file. The web front end does not use /etc/zabbix/zabbix_server.conf, so if you're having configuration problems with the web front end, making changes in /etc/zabbix/zabbix_server.conf is unlikely to fix anything.

              If you want to specify database connection parameters for the web front end, that's done within the conf/zabbix.conf.php file that's within the Zabbix web root.

              Comment

              • venkatesh.samineni
                Junior Member
                • Mar 2024
                • 1

                #8
                my soultion was, DBPassword no special charecter in password for zabbix DBuser

                Comment

                Working...