TANGO DB Error Reason=CANNOT_CONNECT_MYSQL

Hi All

I am facing problem for Step-1 - Running given in README.
Following is the error thrown while executing

main(): arrived
Received a CORBA::Exception
Tango exception
Severity = ERROR
Error reason = CANNOT_CONNECT_MYSQL
Desc : Failed to connect to TANGO database (error = Access denied for user 'root'@'localhost' (using password: NO))
Origin : DataBase::init_device()

Exiting

Any Help Will be appreciated.

Thanks
Balkrishna
Hi Balkrishna,

I presume this is the error you got when trying to run the DataBaseds device server. This server needs to connect to the mysql database which is probably password protected. You can check this by trying to run the command line client mysql : "mysql tango".

The user and password is the one you specified when installing mysql and which you also gave again when doing the tango installation.

The username and password are required to be passed as environment variables MYSQL_USER and MYSQL_PASSWORD. You can either do this and try running
DataBaseds 2 -ORBendPoint giop:tcp::10000
In the above example the port number is set to 10000 which means you need to specify TANGO_HOST=localhost:10000 for TANGO servers and clients to connect to it.

The environment variables are automatically picked up by the tango_dbase system V startup script via this file: /var/lib/tango/.my.cnf (at least on Debian systems) i.e. the ones defined in your shell are ignored when using tango_dbase to start the database server.

More info here: http://www.esrf.eu/computing/cs/tango/tango_doc/kernel_doc/ds_prog/node14.html
Hello,

somehow with this command:

./configure –with-mysqlclient-lib=/usr/lib64/mysql –with-mysql-admin=root –with-mysql-ho=localhost –with-mysql-admin-passwd=

I manage to get all the configurations right:


Configuration (tango):

        Source code location:   .
        Version:                9.2.5a
        Compiler:               gcc,g++

        OMNIORB PATH:           /usr/local
        OMNIORB VERSION:        

        ZMQ PATH:               /usr
        ZMQ VERSION:            4.1.4

        JAVA PATH:              /usr/bin/java
        JAVA VERSION:           1.8.0_131

        MYSQL CLIENT LIB:  -L/usr/lib64/mysql -lmysqlclient
        MYSQL VERSION:     5.7.18
        MYSQL CONNECTION:  OK

build:
        libraries:              yes
        java application:       yes
        access control server:  yes
        database server:        yes
        database schema create: yes


But when I start the tango process, it keeps trying to access the DB with my own user (I think):

[jr@localhost]$ tango start
Starting TANGO database
Starting TANGO Database Server
main(): arrived 

                               ~/Downloads/tango-9.2.5a
[jr@localhost]$ Received a CORBA::Exception
Tango exception
Severity = ERROR 
Error reason = CANNOT_CONNECT_MYSQL
Desc : Failed to connect to TANGO database (error = Access denied for user 'jr'@'localhost' (using password: NO))
Origin : DataBase::init_device()

Exiting

I have ~/.my.cnf like this:



[client]
user 		= root
password 	= 
host		= localhost:10000



Any other clue why? (I am in a Centos 7)


R,
J.
Can you try to remove the line containing host in your ~/.my.cnf file?

I think there is a confusion here between the Tango Database server, which is a Tango device server which should probably listen on the port 10000 (if we manage to make it start) of your machine and the MySQL server, which is probably listening on another port.

Can you connect to your MySQL database using
mysql -D tango
command?

Cheers,
Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Yes,

I think your advice is in the right direction. With the host line I get:

[jr@localhost]$ mysql -D tango
ERROR 2005 (HY000): Unknown MySQL server host 'localhost:10000' (110)

After I remove it:


jr@localhost]$ mysql -D tango
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 55
Server version: 5.7.18 MySQL Community Server (GPL)

Copyright © 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show tables;
+——————————–+
| Tables_in_tango                |
+——————————–+
| access_address                 |
| access_device                  |
| attribute_alias                |
| attribute_class                |
| class_attribute_history_id     |
| class_history_id               |
| class_pipe_history_id          |
| device                         |
| device_attribute_history_id    |
| device_history_id              |
| device_pipe_history_id         |
| event                          |
| object_history_id              |
| property                       |
| property_attribute_class       |
| property_attribute_class_hist  |
| property_attribute_device      |
| property_attribute_device_hist |
| property_class                 |
| property_class_hist            |
| property_device                |
| property_device_hist           |
| property_hist                  |
| property_pipe_class            |
| property_pipe_class_hist       |
| property_pipe_device           |
| property_pipe_device_hist      |
| server                         |
+——————————–+
28 rows in set (0.00 sec)

But now the 'Tango Database server' gives this:


jr@localhost]$ tango start
Starting TANGO database
Starting TANGO Database Server
main(): arrived 
main(): export DataBase as named servant (name=database)
Received a CORBA::Exception
Tango exception
Severity = ERROR 
Error reason = DB_DeviceNotDefined
Desc : device dserver/databaseds/2 not defined in the database !
Origin : DataBase::ExportDevice()

Exiting
Failed to start Tango database server
From mysql client tool, could you please execute the following SQL statement?
SELECT server FROM device WHERE name LIKE 'dserver/databaseds/2';
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Empty smile


[jr@localhost]$ mysql -D tango
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.7.18 MySQL Community Server (GPL)

Copyright © 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show tables;
+——————————–+
| Tables_in_tango                |
+——————————–+
| access_address                 |
| access_device                  |
| attribute_alias                |
| attribute_class                |
| class_attribute_history_id     |
| class_history_id               |
| class_pipe_history_id          |
| device                         |
| device_attribute_history_id    |
| device_history_id              |
| device_pipe_history_id         |
| event                          |
| object_history_id              |
| property                       |
| property_attribute_class       |
| property_attribute_class_hist  |
| property_attribute_device      |
| property_attribute_device_hist |
| property_class                 |
| property_class_hist            |
| property_device                |
| property_device_hist           |
| property_hist                  |
| property_pipe_class            |
| property_pipe_class_hist       |
| property_pipe_device           |
| property_pipe_device_hist      |
| server                         |
+——————————–+
28 rows in set (0.00 sec)

mysql> SELECT server FROM device WHERE name LIKE 'dserver/databaseds/2';
Empty set (0.00 sec

Interesting…
It looks like you encountered a problem during the Tango database creation.
Could you please try:
SELECT * from device\G

If this returns an empty set, I would suggest to remove the Tango database
DROP database tango;

and compile again the distribution…

Kind regards,
Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Yes,

That solved it. Thanks a lot.

smile
 
Register or login to create to post a reply.