Connecting to Applications Manager's bundled database

Connecting to Applications Manager's bundled database

How can I connect to Applications Manager's back-end database?

Note: Take a backup of the AppManager directory before modifying anything in the database.

Check am.dbserver.type value in <Applications Manager Home>\conf\AMServer.properties file to find if you are using PGSQL or MySQL as backend.

PostgreSQL database (Standalone Applications Manager):

You can connect to the PGSQL database through the following commands from the server where Applications Manager is installed. "amdb" is the name of the database of Applications Manager. 15432 is the port on which Applications Manager PGSQL database runs (you can get this from am.db.port value in <Applications Manager Home>\conf\AMServer.properties file).

Windows Command:
AppManagerHome\working\pgsql\bin>set PGPASSWORD=appmanager
AppManagerHome\working\pgsql\bin>psql -p 15432 -U postgres -h localhost  -d amdb

Linux Command:
AppManagerHome/working/pgsql/bin$export PGPASSWORD=appmanager
AppManagerHome/working/pgsql/bin$./psql -p 15432 -U postgres -h localhost  -d amdb

APM Plugin (Applications Manager plugin installed on OpManager):

Just use the below command to connect to the APM Plugin database (amdb) from the OpManager/pgsql/bin folder.

Windows: psql -p 13306 -U postgres -h localhost -d amdb
Linux: ./psql -p 13306 -U postgres -h localhost -d amdb

Kindly follow the below steps to connect to the Applications Manager plugin DB if OpManager upgraded PGSQL to 12.5.xx :

1) First, connect to the OpManager DB using the below command: 
      psql.exe -U dbuser -h 127.0.0.1 -p 13306 <OpManager DB Name>
2) Then enter the Password for user dbuser.
5
3) Once connected to the DB, to list the DB's inside the OpManager DB, enter the command: \l 
4) After checking the Applications Manager plugin DB name, enter the command: \c <DB name>
         Example: \c amdb
5) Now it will connect to the Applications Manager plugin database.

MySQL Database:

You can connect to the MySQL database through the following commands from the server where Applications Manager is installed. "AMDB" is the name of the database of Applications Manager. 13326 is the port on which Applications Manager MySQL database runs (you can get this from am.db.port value in <Applications Manager Home>\conf\AMServer.properties file).

Windows Command: AppManagerHome\working\mysql\bin>mysql.exe -h localhost -u root -P 13326 -pappmanager -D AMDB -A
Linux Command: AppManagerHome\working\mysql\bin>./mysql -h localhost -u root -pappmanager --socket=./../mysql.sock -D AMDB -A

Troubleshooting PGSQL Connection refused error:

In the AppManager server, please open the WordPad with admin rights and open the hosts file present under C:\Windows\system32\drivers\etc\ directory or under /etc directory in case of Linux then remove the comment hashtag (#) symbol as shown below and save it.
 
#     127.0.0.1       localhost
             to
     127.0.0.1       localhost

In the same location if you have IPV6 entry in hosts file, comment that and save the file.

# ::1             localhost

In the same location if you have IPV6 entry in hosts file, comment that and save the file.

#::1            localhost6.localdomain6 localhost6

      • Related Articles

      • Maintenance of Applications Manager

        Applications Manager with MySQL database Open services.msc, stop “ManageEngine Applications Manager” service or via command prompt with administrator permission. If using command prompt, navigate to <Applications Manager Home> directory and execute ...
      • Migrating the JRE bundled in Applications Manager

        JRE Upgrade Document for Applications Manager This document helps the end-user in upgrading to the latest version of Java used in Applications Manager. The steps for Java upgrade in both Windows (Service and Non-Service mode) and Linux installations ...
      • Installing Applications Manager in AWS

        Applications Manager can be installed in EC2 instances in both Windows and Linux platforms.  Applications Manager comes with bundled PostgreSQL. Installing Applications Manager in EC2 for Windows Go to EC2 console and launch an "Windows" instance ...
      • Applications Manager DB Maintenance for PGSQL Backend

        Windows Installations Note: Please take complete db backup using the <AppManager Home>\bin\BackupPGSQLDB.bat (or BackupPGSQLDB.sh) script without fail before following the below steps: Open services.msc, stop “ManageEngine Applications ...
      • Error message while performing database backup of Applications Manager

        While performing a database backup operation of Applications Manager build with Pgsql backend, you may encounter the following error, especially when your database size has grown bigger with a large number of tables.   pg_dump: WARNING: out of shared ...