Troubles upon installing mysql and tango server on WINDOWS10
I am trying to implement a Tango Control System on a an experiment behind a High Power Laser Chain. The main purpose is to centralize all the diagnostic elements in one terminal and to pilot them with only a Tango Based API, able to grab all the data in a file, possibly in RT mode. I am new as developer, beforehand I have been acquainted with Tango use on FERMI FEL. Up to now I do not mean to implement it on all the laser chain and at the interface laser chain - beamline experiment, just the experiment.
This the issue concerning, upon installation, the integration between MySQL and Tango Database: I followed the instructions line by line ((screenshots Instructions_TANGO_1 et Instructions_TANGO_2 attached files)on TANGO Documentation Site:
/> Install MySQL server with the two environment variable MySQL_USER = ****** et MYSQL_PASSWORD = ****** => OK ;
/> C:\Program Files\tango\share\tango\db\create_db.bat
mysql : [Warning] Using a password on the command line interface can be insecure (no matter for me either) ;
ERROR 1007 (HY000) at line 2 in file ‘C:\Program Files\tango\share\tango\db\create_db.sql’: Can’t create database ‘tango’; database exists
Then I tried to create a service with nssm
/> C:\Program Files\tango\bin\nssm install Tango-DataBaseds => Installation successful.
But once I tried to start the service :
/> C:\Program Files\tango\bin\nssm start Tango-DataBaseds
Tango-DataBaseds : Status Value SERVICE_STOPPED unexpected by answering to START command
The service for the Tango DataBase seems to be there, but it cannot be started and, moreover, if I try to start MySQL I get :
/> C:\Program Files\tango\bin\mysql
ERROR 1045 (28000) : Access denied for user ‘ODBC’@’localhost’ (using password: YES)
I followed properly several times the instruction, but nothing. Where am I wrong ?
Have you tried starting manually your database DS (using the start-db.bat from the tango bin directory)? The error may be more verbose.
Is also your TANGO_HOST system variable properly set (like 127.0.0.1:20000)?
Guillaume DI FRANCO
Thales - Software Engineer Manager
As Guillaume pointed out, starting the database server (or any device server) temporarily from command line can yield more useful info. Once that works, the service should work, too (if it doesn't, then some Environment variables etc may be different, but your screenshot from NSSM config looks OK).
The first MySQL error says the DB already exists, maybe you ran the command more than once?
I'm not familiar with the mysql.exe in tango\bin (which evidently tries to access MySQL with the user "ODBC" instead of e.g. tango or your admin account), I used the MySQL Workbench to check if the DB was correctly created.
What version of MySQL did you install? The screenshots seem to indicate 8.0. After always having trouble with changed defaults and syntax in newer versions, we stuck to using MySQL 5.7 as in the instructions and all went fine (there are more posts here on the forum about weird SQL errors during create_db.bat or later during first device server creation, these can point to compatibility problems of the MySQL version). Not saying this is necessary or recommended, but from experience this works, and any newer version seems to require changes in the create_db.bat (and maybe more).
PS. To check all ENV variables like Path and TANGO_ROOT/TANGO_HOST etc at once, type the command "set" which shows all ENV variables
PPS. We have been using Tango now for a while in CALA (cala-laser.de, Munich) on a mix of Windows servers/clients and Linux servers. All new device servers we try to make purely in Python+PyTango.
Dear Guillaume and Leonard,
thank you very much for your advice and suggestions. Finally I succeeded by :
-reinstalling MySql Server 5.7 instead of 8.0
-Removing three stopped Services similar to Tango-Baseds from the Registry
-Modifying the TANGO_HOST environment variable from "localhost::10000" to "real hostname::20000"
I could start the server by the start-db.bat, then I created the service with nssm.
everything worked and, as a test I could start Jive connected to the host without any problem.
Thank You very much for your suggestions.
|Bravo David ! (private remark: tu vois, c'est le bon endroit pour parler Tango).|