Changing the Username and Password and Creating Additional Users for the Inventory Management System SQL Interface

The database administrator can change the password of the database user already configured to access the Inventory Management System SQL interface. The database administrator can also create additional users to access the Inventory Management System SQL interface and grant the required privileges by using the sample SQL query below.

An SQL user with grant privileges (for example, root) can execute these statements:

-- grant read-only privilege to the inventory tables of @DBNAME@ for @DBUSER_IMS@, 
-- per the specification of the interface module 'core' and 'ims'.
-- @DBNAME@ is the name of the database, e.g. 'jtk' or 'demo'
-- @DBUSER_IMS@ is the name of the database user for the SQL interface to IMS
-- @DBUSER_IMS_PASSWORD@ is the password of the database user for the SQL interface to IMS
GRANT SELECT (id) ON @DBNAME@.devices TO @DBUSER_IMS@@localhost IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (id) ON @DBNAME@.devices TO @DBUSER_IMS@@"127.0.0.1" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (id) ON @DBNAME@.devices TO @DBUSER_IMS@@"@HOST_NAME@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (id) ON @DBNAME@.devices TO @DBUSER_IMS@@"@HOST_IP@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (id) ON @DBNAME@.devices TO @DBUSER_IMS@@"%" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (name) ON @DBNAME@.devices TO @DBUSER_IMS@@localhost IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (name) ON @DBNAME@.devices TO @DBUSER_IMS@@"127.0.0.1" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (name) ON @DBNAME@.devices TO @DBUSER_IMS@@"@HOST_NAME@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (name) ON @DBNAME@.devices TO @DBUSER_IMS@@"@HOST_IP@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (name) ON @DBNAME@.devices TO @DBUSER_IMS@@"%" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (hostname) ON @DBNAME@.devices TO @DBUSER_IMS@@localhost IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (hostname) ON @DBNAME@.devices TO @DBUSER_IMS@@"127.0.0.1" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (hostname) ON @DBNAME@.devices TO @DBUSER_IMS@@"@HOST_NAME@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (hostname) ON @DBNAME@.devices TO @DBUSER_IMS@@"@HOST_IP@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (hostname) ON @DBNAME@.devices TO @DBUSER_IMS@@"%" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (model) ON @DBNAME@.devices TO @DBUSER_IMS@@localhost IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (model) ON @DBNAME@.devices TO @DBUSER_IMS@@"127.0.0.1" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (model) ON @DBNAME@.devices TO @DBUSER_IMS@@"@HOST_NAME@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (model) ON @DBNAME@.devices TO @DBUSER_IMS@@"@HOST_IP@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (model) ON @DBNAME@.devices TO @DBUSER_IMS@@"%" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (comment) ON @DBNAME@.devices TO @DBUSER_IMS@@localhost IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (comment) ON @DBNAME@.devices TO @DBUSER_IMS@@"127.0.0.1" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (comment) ON @DBNAME@.devices TO @DBUSER_IMS@@"@HOST_NAME@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (comment) ON @DBNAME@.devices TO @DBUSER_IMS@@"@HOST_IP@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (comment) ON @DBNAME@.devices TO @DBUSER_IMS@@"%" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (deleted_on) ON @DBNAME@.devices TO @DBUSER_IMS@@localhost IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (deleted_on) ON @DBNAME@.devices TO @DBUSER_IMS@@"127.0.0.1" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (deleted_on) ON @DBNAME@.devices TO @DBUSER_IMS@@"@HOST_NAME@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (deleted_on) ON @DBNAME@.devices TO @DBUSER_IMS@@"@HOST_IP@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT (deleted_on) ON @DBNAME@.devices TO @DBUSER_IMS@@"%" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.module_interface_version TO @DBUSER_IMS@@localhost IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.module_interface_version TO @DBUSER_IMS@@"127.0.0.1" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.module_interface_version TO @DBUSER_IMS@@"@HOST_NAME@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.module_interface_version TO @DBUSER_IMS@@"@HOST_IP@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.module_interface_version TO @DBUSER_IMS@@"%" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.hardware_inventory TO @DBUSER_IMS@@localhost IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.hardware_inventory TO @DBUSER_IMS@@"127.0.0.1" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.hardware_inventory TO @DBUSER_IMS@@"@HOST_NAME@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.hardware_inventory TO @DBUSER_IMS@@"@HOST_IP@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.hardware_inventory TO @DBUSER_IMS@@"%" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.software_inventory TO @DBUSER_IMS@@localhost IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.software_inventory TO @DBUSER_IMS@@"127.0.0.1" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.software_inventory TO @DBUSER_IMS@@"@HOST_NAME@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.software_inventory TO @DBUSER_IMS@@"@HOST_IP@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.software_inventory TO @DBUSER_IMS@@"%" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.packages_inventory TO @DBUSER_IMS@@localhost IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.packages_inventory TO @DBUSER_IMS@@"127.0.0.1" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.packages_inventory TO @DBUSER_IMS@@"@HOST_NAME@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.packages_inventory TO @DBUSER_IMS@@"@HOST_IP@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.packages_inventory TO @DBUSER_IMS@@"%" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.licensing_inventory TO @DBUSER_IMS@@localhost IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.licensing_inventory TO @DBUSER_IMS@@"127.0.0.1" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.licensing_inventory TO @DBUSER_IMS@@"@HOST_NAME@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.licensing_inventory TO @DBUSER_IMS@@"@HOST_IP@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.licensing_inventory TO @DBUSER_IMS@@"%" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.events_inventory TO @DBUSER_IMS@@localhost IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.events_inventory TO @DBUSER_IMS@@"127.0.0.1" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.events_inventory TO @DBUSER_IMS@@"@HOST_NAME@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.events_inventory TO @DBUSER_IMS@@"@HOST_IP@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.events_inventory TO @DBUSER_IMS@@"%" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.inventory_event_types TO @DBUSER_IMS@@localhost IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.inventory_event_types TO @DBUSER_IMS@@"127.0.0.1" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.inventory_event_types TO @DBUSER_IMS@@"@HOST_NAME@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.inventory_event_types TO @DBUSER_IMS@@"@HOST_IP@" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';
GRANT SELECT ON @DBNAME@.inventory_event_types TO @DBUSER_IMS@@"%" IDENTIFIED BY '@DBUSER_IMS_PASSWORD@';