niota

fascinating. logical.

User Tools

Site Tools


niota-docs:niota_system_config_connection

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
niota-docs:niota_system_config_connection [2022/03/02 12:51]
admin [use Windows Authentication]
niota-docs:niota_system_config_connection [2025/07/17 14:11] (current)
Line 1: Line 1:
 +==== introduction =====
 +
 +Before you can use niota to edit data in your databases you have to set up connections to these databases. A connections consists of 
 +  * login for a technical user that is allowed to connect to the database ​
 +  * server (host) where the database is hosted
 +  * additional settings for the connection
 +
 +The avoid redundancy these components of a connection are also split to several configuration tables. To set up a connetion you have to configure the login, the host and finally the connection itself.
 +
 +
 +==== configure hosts =====
 +Edit file ''​hosts.php''​ in your client specific conf-folder.
 +You will find some predefined hosts there like for Zagreus web service calls or niota meta database. In case meta database server is not running on the same machine as the application itself you have to adapt the IP address. In case both are running on the same machine you can keep pre-configured ''​localhost''​ settings. Adapt the IP port to your needs in case you have configured a different port on your local install.
 +
 +** Please mind that syntax for host:port might differ on different database management systems. **
 +
 +<​code>​
 +/* adapt your IP addresses and ports here */ 
 +const ET_HOST = [
 +        ET_METADATA_CONNECTION =>'​localhost:​3366',​
 + ET_ZAGREUS_CONNECTION =>'​localhost:​7323',​
 +        "​SQLSERVER"​ =>'​localhost,​1433'​
 + ];
 +</​code>​
 +
 +Microsoft SQL Server needs a comma between host address and port instead of a colon!
 +
 +** MSSQL named instances ** require the instance name instead of the IP address - in case you need native SQL connection.
 +<​code>​
 +const ET_HOST = [
 +        ET_METADATA_CONNECTION =>'​127.0.0.1:​3366',​
 + ET_ZAGREUS_CONNECTION =>'​http://​127.0.0.1:​7323',​
 +        "​SQLSERVER"​ =>'​C9RRELE02\MSSQL_RITCON_E'​
 + ];
 +</​code>​
 +
 +==== configure logins =====
 +Edit file ''​hosts.php''​ in your client specific conf-folder.
 +You will find some predefined logins there like for Zagreus web service calls or niota meta database. In case you decided to have different users/login than the predefined change here the settings accordingly.
 +
 +** We strongly recommend to use dedicated niota users on your database systems and restrict these users to minimum access rights. Do not user system admin users to access your data via niota! **
 +
 +** Use password encryption for your technical users! **
 +
 +In the shipped configuration the names of the logins are equal to the names of the host. This is just to simplify the naming issue. In case you have the some login for different SQL servers or Oracle or ... you can of course name the hosts differently then the logins.
 +
 +<​code>​
 +/* adapt your login users and passwords here */ 
 +const ET_LOGIN = [
 +        ET_METADATA_CONNECTION => array(
 + LOGIN_USERNAME => '​niota_web',​
 + LOGIN_PASSWORD => '​*****',​
 + LOGIN_ENCRYPTED => true
 + ),
 +        ET_ZAGREUS_CONNECTION => array(
 + LOGIN_USERNAME => '​admin',​
 + LOGIN_PASSWORD => '​*****',​
 + LOGIN_ENCRYPTED => true
 + ),
 +        "​SQLSERVER"​ => array(
 + LOGIN_USERNAME => '​niota_web',​
 + LOGIN_PASSWORD => '​*****',​
 + LOGIN_ENCRYPTED => false
 + )
 +</​code>​
 +
 +
 ==== configure connections ===== ==== configure connections =====
  
-Before ​you can use niota to edit data in your databases ​you have to set up connections to this databases +After you have defined ​your database hosts and the login you can configure the connecion(s). You have to edit the file ''​connections.php''​ in your client specific conf-folder.  
-You have to edit the connections ​file manually on the server.+ 
 +** To assure that your login has really access rights to the database where you want to setup the connection we recommend to test the login with a standard client for your database **  
 + 
 +If you use MS SQL Server you can connection via Management Studio, if you use Oracle, you can use SQL Developer, ....
  
-  * logon to the server where N-PAPP is installed 
-  * navigate to ''​\app\conf''​ - folder 
-  * edit file ''​connections.php''​ 
  
 One connection out of the array of configured connections must be set as the **metadata database connection**. This connection must be a MySQL connection. One connection out of the array of configured connections must be set as the **metadata database connection**. This connection must be a MySQL connection.
  
-Other database connections can be set to your local database management systems and may be of this types+Other database connections can be set to your local database management systems and may be of these types
   * MySQL Server   * MySQL Server
   * MS SQL Server   * MS SQL Server
Line 138: Line 205:
  
 === use native connection === === use native connection ===
 +  * prerequisits for PHP 7: appropritate php driver dll file: c:\Program Files\php-7.3.8_x64\ext\**php_sqlsrv_73_ts_x64.dll**. MSSQL native driver requires ODBC driver to be installed. For php_sqlsrv_73_ts_x64.dll native driver install **ODBC Driver 17 for SQL Server** ODBC driver.
   * edit file ''​niota/​app/​conf/​connections.php''​ according to the connection details. ​   * edit file ''​niota/​app/​conf/​connections.php''​ according to the connection details. ​
 See the sample connection to modify in file “niota/​app/​conf/​connections_sample.php”. See the sample connection to modify in file “niota/​app/​conf/​connections_sample.php”.
  
   * test the connection by loading a grid in niota   * test the connection by loading a grid in niota
 +  * 
  
-^"​SQL_Server_ODBC"​=>​ array ( ^"​SQL_Server_native"​=>​ array (^ +^"​SQL_Server_ODBC"​=>​ array ( ^"​SQL_Server_native"=> array ( ^"​SQL_Server_native_named_instance"=> array ( ^ 
-|''​PHPGRID_DB_TYPE => DB_TYPE_ODBC_MSSQL''​|''​PHPGRID_DB_TYPE => DB_TYPE_MSSQL''​+|PHPGRID_DB_TYPE => DB_TYPE_ODBC_MSSQL|PHPGRID_DB_TYPE => DB_TYPE_MSSQL|PHPGRID_DB_TYPE => DB_TYPE_MSSQL
-|''​PHPGRID_DB_HOSTNAME => "​odbc_connection_resource_name"​''​|''​PHPGRID_DB_HOSTNAME => “myhostname.com,​1433”''​+|PHPGRID_DB_HOSTNAME => "​odbc_connection_resource_name"​|PHPGRID_DB_HOSTNAME => “myhostname.com,​1433”|PHPGRID_DB_HOSTNAME => “MYSQL\MYINSTANCE”
-|''​PHPGRID_DB_CHARSET => "​iso-8859-2"​''​|''​PHPGRID_DB_CHARSET => "​UTF-8"​'' ​or ''​PHPGRID_DB_CHARSET => SQLSRV_ENC_CHAR''​|+|PHPGRID_DB_CHARSET => "​iso-8859-2"​|PHPGRID_DB_CHARSET => "​UTF-8"​ or PHPGRID_DB_CHARSET => SQLSRV_ENC_CHAR|...|
  
 ((Table 1 SQL Server connection definitions (ODBC vs. native).)) Only differences are listed. ((Table 1 SQL Server connection definitions (ODBC vs. native).)) Only differences are listed.
Line 182: Line 250:
 Take care on specifying the AD user as „domain\user-name”. E.g.: in the picture domain is „win19” and the user name is „test”. Take care on specifying the AD user as „domain\user-name”. E.g.: in the picture domain is „win19” and the user name is „test”.
  
-===== connection definitions ​=====+**connection definitions**\\ 
  
 ^"​SQL_Server_ODBC"​=>​ array ( ^"​SQL_Server_native"​=>​ array (^ ^"​SQL_Server_ODBC"​=>​ array ( ^"​SQL_Server_native"​=>​ array (^
-|''​PHPGRID_DB_TYPE => DB_TYPE_ODBC_MSSQL''​|''​PHPGRID_DB_TYPE => DB_TYPE_MSSQL''​+|PHPGRID_DB_TYPE => DB_TYPE_ODBC_MSSQL|PHPGRID_DB_TYPE => DB_TYPE_MSSQL| 
-|''​PHPGRID_DB_HOSTNAME => "​odbc_connection_resource_name"​''​|''​PHPGRID_DB_HOSTNAME => "​SQL-Server-instance-name”''​+|PHPGRID_DB_HOSTNAME => "​odbc_connection_resource_name"​|PHPGRID_DB_HOSTNAME => "​SQL-Server-instance-name”| 
-|''​PHPGRID_DB_USERNAME => "",''​|''​PHPGRID_DB_USERNAME => "",''​| +|...|...|
-|''​PHPGRID_DB_PASSWORD => "",''​|''​PHPGRID_DB_PASSWORD => "",''​|+
  
 ((Table 2 SQL Server connection definitions (ODBC vs. native) with Windows Authentication )) Only differences and user authentication settings are listed. ((Table 2 SQL Server connection definitions (ODBC vs. native) with Windows Authentication )) Only differences and user authentication settings are listed.
niota-docs/niota_system_config_connection.1646221880.txt.gz · Last modified: 2025/07/17 14:11 (external edit)