Ad Widget

Collapse

cannot use database "zabbix": database is not a Zabbix database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • netcruiser
    Junior Member
    • May 2024
    • 2

    #1

    cannot use database "zabbix": database is not a Zabbix database

    I'm a newcomer to Zabbix, installed Zabbix 6.4 on Oracle Linux 8 following the instructions: Download and install Zabbix 6.4 for Oracle Linux 8 Server, Frontend, Agent, MySQL, Apache

    Now I won't able to start Zabbix server:
    [root@cacs-sclab-mon zabbix]# systemctl status zabbix-server.service
    ● zabbix-server.service - Zabbix Server
    Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; disabled; vendor preset: disabled)
    Active: activating (auto-restart) (Result: protocol) since Wed 2024-05-22 14:25:46 PDT; 583ms ago
    Process: 481432 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
    [root@cacs-sclab-mon zabbix]# systemctl status zabbix-server.service
    ● zabbix-server.service - Zabbix Server
    Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; disabled; vendor preset: disabled)
    Active: activating (auto-restart) (Result: protocol) since Wed 2024-05-22 14:27:37 PDT; 410ms ago
    Process: 482127 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)

    And log files is very confusing:
    [root@cacs-sclab-mon zabbix]# tail -f /var/log/zabbix/zabbix_server.log
    482600:20240522:142848.437 cannot use database "zabbix": database is not a Zabbix database
    482676:20240522:142900.675 Starting Zabbix Server. Zabbix 6.4.15 (revision 09711f1760b).
    482676:20240522:142900.675 ****** Enabled features ******
    482676:20240522:142900.676 SNMP monitoring: YES
    482676:20240522:142900.677 IPMI monitoring: YES
    482676:20240522:142900.678 Web monitoring: YES
    482676:20240522:142900.678 VMware monitoring: YES
    482676:20240522:142900.679 SMTP authentication: YES
    482676:20240522:142900.680 ODBC: YES
    482676:20240522:142900.680 SSH support: YES
    482676:20240522:142900.681 IPv6 support: YES
    482676:20240522:142900.682 TLS support: YES
    482676:20240522:142900.683 ******************************
    482676:20240522:142900.683 using configuration file: /etc/zabbix/zabbix_server.conf
    482676:20240522:142900.688 [Z3005] query failed: [1146] Table 'zabbix.users' doesn't exist [select userid from users limit 1]
    482676:20240522:142900.689 cannot use database "zabbix": database is not a Zabbix database
    482753:20240522:142912.924 Starting Zabbix Server. Zabbix 6.4.15 (revision 09711f1760b).
    482753:20240522:142912.925 ****** Enabled features ******
    482753:20240522:142912.926 SNMP monitoring: YES
    482753:20240522:142912.927 IPMI monitoring: YES
    482753:20240522:142912.927 Web monitoring: YES
    482753:20240522:142912.928 VMware monitoring: YES
    482753:20240522:142912.929 SMTP authentication: YES
    482753:20240522:142912.930 ODBC: YES
    482753:20240522:142912.930 SSH support: YES
    482753:20240522:142912.931 IPv6 support: YES
    482753:20240522:142912.932 TLS support: YES
    482753:20240522:142912.932 ******************************
    482753:20240522:142912.933 using configuration file: /etc/zabbix/zabbix_server.conf
    482753:20240522:142912.937 [Z3005] query failed: [1146] Table 'zabbix.users' doesn't exist [select userid from users limit 1]
    482753:20240522:142912.937 cannot use database "zabbix": database is not a Zabbix database

    No user found in database:
    [root@cacs-sclab-mon zabbix]# mysql -uroot -p
    mysql> select * from users
    -> ^C

    I tried to follow some suggestions to populate the database and that didn't work for me:

    # mysql -uroot -p
    password
    mysql> drop database zabbix;
    mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
    mysql> set global log_bin_trust_function_creators = 1;
    mysql> quit;

    ​Thanks in advance for all the help!!!
  • Singularity
    Member
    • Aug 2020
    • 81

    #2
    I hope you executed all the steps !
    Seems schema problem.

    login to mysql as root
    mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
    mysql> create user zabbix@localhost identified by 'password';
    mysql> grant all privileges on zabbix.* to zabbix@localhost;
    mysql> set global log_bin_trust_function_creators = 1;
    mysql> quit;

    zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

    login to mysql as root
    mysql> set global log_bin_trust_function_creators = 0;
    mysql> quit;

    systemctl restart apache2 or httpd
    systemctl restart zabbix-server

    Comment

    • netcruiser
      Junior Member
      • May 2024
      • 2

      #3
      Thank you very much Singularity !

      Now I found out what is the problem when I installed Zabbix:

      zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

      took several minutes to complete and I thought it's hung and Ctrl-C to get out.

      After I did this again and wait it finish by itself, everything works like a charm!!!

      Thanks a lot Singularity and Community - I really appreciate the quick response and huge help!!!

      Comment

      • NoahTucker
        Junior Member
        • Mar 2024
        • 3

        #4
        Originally posted by Singularity
        I hope you executed all the steps !
        Seems schema problem.

        login to mysql as root
        mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
        mysql> create user zabbix@localhost identified by 'password';
        mysql> grant all privileges on zabbix.* to zabbix@localhost;
        mysql> set global log_bin_trust_function_creators = 1;
        mysql> quit;

        zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

        login to mysql as root
        mysql> set global log_bin_trust_function_creators = 0;
        mysql> quit;

        systemctl restart apache2 or httpd
        systemctl restart zabbix-server
        Thanks for answering, you made my day. I appreciate you from the bottom of my heart.

        Comment

        Working...