Database initialization problem.
-
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.20Configuration 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 failedPermissions 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 78But 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.
-
@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"
-
@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 existsAs 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? -
Everything is ok now. The problem was in MySql.
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