This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
niota-docs:niota_system_config_connection [2025/04/24 12:14] admin [configure hosts] |
niota-docs:niota_system_config_connection [2025/07/17 14:11] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ==== Introduction ===== | + | ==== 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 | Before you can use niota to edit data in your databases you have to set up connections to these databases. A connections consists of | ||
| Line 6: | Line 6: | ||
| * additional settings for the connection | * 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 it self. | + | 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. |
| - | We strongly recommend to user dedicated niota users on your database system and restrict these users to minimum access rights. | ||
| ==== configure hosts ===== | ==== configure hosts ===== | ||
| Edit file ''hosts.php'' in your client specific conf-folder. | 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 es the application itself you have to adapt the IP address. In case both ar 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. | + | 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. ** | ** Please mind that syntax for host:port might differ on different database management systems. ** | ||
| Line 25: | Line 24: | ||
| </code> | </code> | ||
| - | ==== configure login ===== | + | 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 173: | Line 210: | ||
| * 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 215: | Line 253: | ||
| ^"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. | ||