Ad Widget

Collapse

User's table is empty

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • caselwood
    Junior Member
    • Sep 2018
    • 1

    #1

    User's table is empty

    I am trying to download zabbix onto Ubuntu 18.04.1. I have followed the instructions from the website for this but have been unable to get past the configure DB connection when configuring the frontend. I have the error "Cannot connect to the database - unable to select configuration". I have tried the following with these results.


    caroline@zabbix:/$ ls -1 /usr/share/doc/zabbix-server-mysql*/

    changelog.Debian.gz
    copyright
    create.sql.gz

    caroline@zabbix:/$ cat /var/log/zabbix/zabbix_server.log

    17625:20180925:110411.498 Starting Zabbix Server. Zabbix 3.4.14 (revision 84877).
    17625:20180925:110411.498 ****** Enabled features ******
    17625:20180925:110411.498 SNMP monitoring: YES
    17625:20180925:110411.498 IPMI monitoring: YES
    17625:20180925:110411.498 Web monitoring: YES
    17625:20180925:110411.498 VMware monitoring: YES
    17625:20180925:110411.498 SMTP authentication: YES
    17625:20180925:110411.498 Jabber notifications: YES
    17625:20180925:110411.498 Ez Texting notifications: YES
    17625:20180925:110411.498 ODBC: YES
    17625:20180925:110411.498 SSH2 support: YES
    17625:20180925:110411.498 IPv6 support: YES
    17625:20180925:110411.498 TLS support: YES
    17625:20180925:110411.498 ******************************
    17625:20180925:110411.498 using configuration file: /etc/zabbix/zabbix_server.conf
    17625:20180925:110411.501 cannot use database "zabbix": its "users" table is empty (is this the Zabbix proxy database?)

    From what I have seen - the only solution was to recreate the database making sure to use create.sql.gz and not schema.sql.gz however I have done this and am definitely using this command:

    # zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -uzabbix -p zabbix I have also had problems trying to start the server using:
    # service zabbix-server start and receive:

    ESCOD
    ● zabbix-server.service - Zabbix Server
    Loaded: loaded (/lib/systemd/system/zabbix-server.service; enabled; vendor pr
    Active: activating (auto-restart) (Result: exit-code) since Tue 2018-09-25 14
    Process: 21128 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, st
    Main PID: 17653 (code=exited, status=1/FAILURE)

    Sep 25 14:54:25 zabbix systemd[1]: zabbix-server.service: Failed with result 'ex
    Sep 25 14:54:25 zabbix systemd[1]: Failed to start Zabbix Server.


    Any help is appreciated!

    Thanks


  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    Is it possible to access a database using the mysql command and execute a select statement?
    For example, in the environment I created, the following output was obtained.

    Code:
    $ mysql -uzabbix -p zabbix
    Enter password:
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    mysql> select * from users;
    +--------+-------+--------+---------------+----------------------------------+-----+-----------+------------+-------+---------+------+---------+----------------+------------+---------------+---------------+
    | userid | alias | name   | surname       | passwd                           | url | autologin | autologout | lang  | refresh | type | theme   | attempt_failed | attempt_ip | attempt_clock | rows_per_page |
    +--------+-------+--------+---------------+----------------------------------+-----+-----------+------------+-------+---------+------+---------+----------------+------------+---------------+---------------+
    |      1 | Admin | Zabbix | Administrator | 5fce1b3e34b520afeffb37ce08c7cd66 |     |         1 | 0          | ja_JP | 30s     |    3 | default |              0 |            |             0 |            50 |
    |      2 | guest |        |               | d41d8cd98f00b204e9800998ecf8427e |     |         0 | 15m        | en_GB | 30s     |    1 | default |              0 |            |             0 |            50 |
    +--------+-------+--------+---------------+----------------------------------+-----+-----------+------------+-------+---------+------+---------+----------------+------------+---------------+---------------+
    2 rows in set (0.00 sec)
    
    mysql> quit
    Bye
    $
    In Ubuntu 18.04, the default setting when using MySQL seems to be different from the previous one.
    For example, the security policy seems to have changed, too.
    Has an error occurred when inputting initial data?

    I have been able to successfully populate the initial data with the following procedure with the combination of Ubuntu 18.04.01 + MySQL database server 5.7.23-0ubuntu0.18.04.1 + Zabbix 3.4.14-1+bionic.

    Code:
    $ sudo mysql -uroot -p
    mysql> create database zabbix character set utf8 collate utf8_bin;
    mysql> grant all privileges on zabbix.* to zabbix@localhost identified with mysql_native_password by '<Your password>';
    mysql> quit
    $ zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -uzabbix -p zabbix

    Comment

    • nzbrent
      Junior Member
      • Sep 2020
      • 4

      #3
      All output relating to database errors stem from missing zabbix-server-mysql package files.
      The original create.sql.gz file must be present to populate the database tables. Ls check and if not present refer to a previous post https://www.zabbix.com/forum/zabbix-...e-or-directory. I followed the final suggestion by matz to update 'excludes' by updating /etc/dpkg/dpkg.cfg file.

      .......Problem is dpkg exclude list, so:


      Comment

      • matz
        Junior Member
        • Jul 2017
        • 7

        #4
        nzbrent so, my solution solve your problem?

        Comment


        • nzbrent
          nzbrent commented
          Editing a comment
          matz sorry been a few weeks in responding. Yes your a legend! solution solves issue
      Working...