nxdbmgr not working with mysql

Started by Macphisto, February 08, 2010, 04:51:41 AM

Previous topic - Next topic

Macphisto

Hello

Initializing mysql DB with nxdbmgr is showing this message:

/ # /opt/bin/nxdbmgr  init /opt/share/netxms/sql/dbinit_mysql.sql
NetXMS Database Manager Version 0.2.31

Configuration file OK
Unable to connect to database netxms@localhost as netxms

The following was the configuration in mysql:

/tmp/netxms-0.2.31/contrib # mysql -U mysql -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2323475
Server version: 5.1.25-rc-standard-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE DATABASE netxms;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL ON netxms.* TO netxms IDENTIFIED BY 'PaSsWd';
Query OK, 0 rows affected (0.01 sec)

mysql> \q
Bye

Configuration in netxmsd.conf:

DBDriver = /opt/lib/libnxddr_mysql.so
#
# DBServer
#
DBServer = localhost
#
# DBName
DBName = netxms
#
# DBLogin
#
DBLogin = netxms
#
# DBPassword
#
DBPassword = PaSsWd

May be the initialization script is complaining because password in command line is not allowed in mysql configuration?

Victor Kirhenshtein

Hi!

If you are connecting to localhost, you should grabt access to database in this way:

GRANT ALL ON netxms.* TO netxms@localhost IDENTIFIED BY 'PaSsWd';

Because MySQL threats localhost connections differently. (MySQL page where this behavior is explained: http://dev.mysql.com/doc/refman/5.1/en/adding-users.html).

Best regards,
Victor

Macphisto

Thank you Victor

You are right, now is working fine:

/ # /opt/bin/nxdbmgr check
NetXMS Database Manager Version 0.2.31

Configuration file OK
Checking database:
* Checking node objects...                                              [PASSED]
* Checking interface objects...                                         [PASSED]
* Checking network service objects...                                   [PASSED]
* Checking cluster objects...                                           [PASSED]
* Checking template to node mapping...                                  [PASSED]
* Checking object properties...                                         [PASSED]
* Checking event processing policy...                                   [PASSED]
* Checking collected data...                                            [PASSED]
Database doesn't contain any errors
Database check completed