Steps to create a connection to a local postgres database in pgAdmin ||| :
1. Make sure PostgresSql and its components should be installed in ubuntu system.
2. Check what databases are available in postgresSql through terminal
3. Login to PostresSql server in terminal using following command:
sudo -u postgres psql
With the above command, we are connected to PostgresSql with user postgres . In PostresSql server, user postgres is default user and is superuser.
4. When command in above step is invoked, it asks for password. Enter the password and we are now ready to run psql commands:
5. Run the following command to display available databases in PostgresSql:
Command : \list or \l
6. Let us create a new database name “TestDb” with the following command:
CREATE DATABASE testdb;
7. Connect with database testdb in pgAdmin III :
Above screenshot shows that there is no database.
8. Click at the top left icon to make a connection with database as shown above. New Server Registration box will be opened to enter credentials to connect with the database:
9. Click Ok button after filling information. After clicking Ok button, following screen will be displayed. Again click on Ok button, and “Version not same” pop-up message will be displayed. Again Click on the Ok button:
10. Now database name is displaying under Servers menu:
11. Right now, it is not connected. Double click on the name of database mytestdb to connect: