Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Database initialization problem.

Database initialization problem.

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 41.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X
    X
    Nikita Matov
    wrote on last edited by
    #1

    Hello, Victor!

    I was trying to reinstall NetXMS server, and as I did I was trying to re-initialize database:
    /usr/local/netxms/bin/nxdbmgr init /usr/local/netxms/share/netxms/sql/dbinit_mysql.sql
    NetXMS Database Manager Version 0.2.20

    Configuration file OK
    Initializing database...
    SQL query failed:
    CREATE TABLE config
    (
     var_name varchar(63) not null,
     var_value varchar(255) not null,
     is_visible integer not null default 1,
     need_server_restart integer not null default 0,
     PRIMARY KEY(var_name)
    )
    Database initialization failed
    
    

    Permissions for database schould be ok, because I defined in netxmsd.conf to connect as root.

    Then I tried to initialize database manually, so I did: cat /usr/local/netxms/share/netxms/sql/dbinit_mysql.sql | mysql -u root -p
    Tables were created, but then:

    /usr/local/netxms/bin/netxmsd -D 9
    Using configuration file "/etc/netxmsd.conf"
    Configuration file OK
    [16-Apr-2008 17:08:51] Unable to set codepage to ISO-8859-1
    [16-Apr-2008 17:08:51] Platform subagent "/usr/local/netxms/lib/libnsm_linux.so" successfully loaded
    [16-Apr-2008 17:08:51] Database driver "/usr/local/netxms/lib/libnxddr_mysql.so" loaded and initialized successfully
    [16-Apr-2008 17:08:51] DEBUG: New DB connection opened: handle=0x617250
    [16-Apr-2008 17:08:51] DEBUG: Successfully connected to database [email protected]
    [16-Apr-2008 17:08:51] DEBUG: Failed sync query: "SELECT var_value FROM config WHERE var_name='DBFormatVersion'" [0 ms]
    [16-Apr-2008 17:08:51] SQL query failed (Query = "SELECT var_value FROM config WHERE var_name='DBFormatVersion'")
    [16-Apr-2008 17:08:51] Your database has format version 0, but server is compiled for version 78
    

    But if I go in MySQL and manually do SELECT var_value FROM config WHERE var_name='DBFormatVersion' it returns:
    +-----------+
    | var_value |
    +-----------+
    | 78        |
    +-----------+
    1 row in set (0.00 sec)

    I am using Mysql, during re-installation i dropped netxms database. I tried to install different versions of MySQL, and I tried to re-compile NetXMS server.

    1 Reply Last reply
    0
    • A
      A
      Alex Kirhenshtein
      wrote on last edited by
      #2

      @xojiog said in Database initialization problem.:

      Then I tried to initialize database manually, so I did: cat /usr/local/netxms/share/netxms/sql/dbinit_mysql.sql | mysql -u root -p
      Tables were created, but then:

      Hello.

      Looks like you have created tables in "mysql" databse. Try to "cat ... | mysql -u root -p netxms"

      1 Reply Last reply
      0
      • X
        X
        Nikita Matov
        wrote on last edited by
        #3

        @alk said in Database initialization problem.:

        Looks like you have created tables in "mysql" databse. Try to "cat ... | mysql -u root -p netxms"

        cat /usr/local/netxms/share/netxms/sql/dbinit_mysql.sql | mysql -u root -p netxms
        Enter password:
        ERROR 1050 (42S01) at line 1: Table 'config' already exists

        As I said before:
        But if I go in MySQL and manually do use netxms; SELECT var_value FROM config WHERE var_name='DBFormatVersion'; it returns:
        +-----------+
        | var_value |
        +-----------+
        | 78        |
        +-----------+
        1 row in set (0.00 sec)

        I've tried to install previous version of NetXMS - result is the same.
        As I understand for some reason netxms cannot read or write to database, why can this be?

        1 Reply Last reply
        0
        • X
          X
          Nikita Matov
          wrote on last edited by
          #4

          Everything is ok now. The problem was in MySql.

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          Powered by NodeBB Contributors
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups