Ad Widget

Collapse

Cannot connect to the database. during Zabbix Installation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • habibsalhi
    Junior Member
    • Jun 2022
    • 4

    #1

    Cannot connect to the database. during Zabbix Installation

    hello dears;
    please need your support to finish Zabbix installation because I have a problem with DataBase;
    thanks to the finding below the error appears;
    note that I install the Zabbix Server on a VMware machine ( CentOS and MariaDB)
    after many try to solve it still with the same problem ;Click image for larger version

Name:	2022-06-04 11_00_39-Window.png
Views:	1129
Size:	29.3 KB
ID:	445617


    [root@localhost zabbix]#
    [root@localhost zabbix]# systemctl status zabbix-server.service
    ● zabbix-server.service - Zabbix Server
    Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
    Active: activating (auto-restart) (Result: protocol) since Sat 2022-06-04 15:54:08 CET; 2s ago
    Process: 73145 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
    Main PID: 69203 (code=exited, status=1/FAILURE)

    Jun 04 15:54:08 localhost.localdomain systemd[1]: Failed to start Zabbix Server.
    Jun 04 15:54:08 localhost.localdomain systemd[1]: Unit zabbix-server.service entered failed state.
    Jun 04 15:54:08 localhost.localdomain systemd[1]: zabbix-server.service failed.
    [root@localhost zabbix]# systemctl start zabbix-server
    Job for zabbix-server.service failed. See "systemctl status zabbix-server.service" and "journalctl -xe" for details.
    [root@localhost zabbix]# systemctl status zabbix-server.service
    ● zabbix-server.service - Zabbix Server
    Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
    Active: activating (auto-restart) (Result: protocol) since Sat 2022-06-04 15:57:49 CET; 606ms ago
    Process: 73258 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
    Main PID: 69203 (code=exited, status=1/FAILURE)

    Jun 04 15:57:49 localhost.localdomain systemd[1]: Failed to start Zabbix Server.
    Jun 04 15:57:49 localhost.localdomain systemd[1]: Unit zabbix-server.service entered failed state.
    Jun 04 15:57:49 localhost.localdomain systemd[1]: zabbix-server.service failed.
    [root@localhost zabbix]# journalctl -xe
    -- Support: http://lists.freedesktop.org/mailman.../systemd-devel
    --
    -- Unit zabbix-server.service has failed.
    --
    -- The result is failed.
    Jun 04 15:57:37 localhost.localdomain systemd[1]: Unit zabbix-server.service entered failed state.
    Jun 04 15:57:37 localhost.localdomain systemd[1]: zabbix-server.service failed.
    Jun 04 15:57:47 localhost.localdomain systemd[1]: zabbix-server.service holdoff time over, scheduling restart.
    Jun 04 15:57:47 localhost.localdomain systemd[1]: Stopped Zabbix Server.
    -- Subject: Unit zabbix-server.service has finished shutting down
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman.../systemd-devel
    --
    -- Unit zabbix-server.service has finished shutting down.
    Jun 04 15:57:47 localhost.localdomain systemd[1]: Starting Zabbix Server...
    -- Subject: Unit zabbix-server.service has begun start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman.../systemd-devel
    --
    -- Unit zabbix-server.service has begun starting up.
    Jun 04 15:57:49 localhost.localdomain systemd[1]: Can't open PID file /run/zabbix/zabbix_server.pid (yet?) after start:
    Jun 04 15:57:49 localhost.localdomain systemd[1]: Failed to start Zabbix Server.
    -- Subject: Unit zabbix-server.service has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman.../systemd-devel
    --
    -- Unit zabbix-server.service has failed.
    --
    -- The result is failed.
    Jun 04 15:57:49 localhost.localdomain systemd[1]: Unit zabbix-server.service entered failed state.
    Jun 04 15:57:49 localhost.localdomain systemd[1]: zabbix-server.service failed.

    [root@localhost zabbix]#
  • vladimir_lv
    Senior Member
    • May 2022
    • 240

    #2
    Hi!
    Try to connect MySQL database using your login and password. Type the following command:

    # mysql -uroot -p
    mysql> use zabbix;

    Is everything OK?

    Comment

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

      #3
      "-uroot -p" and "your username and password" in same sentence?
      right....

      Comment


      • vladimir_lv
        vladimir_lv commented
        Editing a comment
        I am sorry, ofc should be -u some_user_who_has_access -p. )))
    • tim.mooney
      Senior Member
      • Dec 2012
      • 1427

      #4
      You don't say which version of Zabbix you're trying to install, so I'll assume you're trying to install the Zabbix 6.0 LTS and that you're installing from the Zabbix packages, not by compiling the source code yourself.

      Considering those assumptions, did you install all the packages listed in Step 2a and Step 2b, here:

      Zabbix is being downloaded over 4 000 000 times every year for a reason. Download and install Zabbix for free and try it yourself!


      Did you then run the commands in Step 2c, to create the 'zabbix' database within MariaDB, create the 'zabbix' user with the appropriate password that you want to use, and then import the initial schema, to create the (blank) tables, etc. ?

      You have to make sure that MariaDB server is running and that you've created the 'zabbix' database and 'zabbix' user and set up the initial schema before you can have either the 'zabbix-server' process or the Zabbix web front-end connect to the database.

      Comment

      Working...