Skip to content

Commit

Permalink
Usability Study adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonWHowell committed Aug 5, 2017
1 parent aefd3e9 commit 8178a59
Showing 1 changed file with 15 additions and 33 deletions.
48 changes: 15 additions & 33 deletions articles/postgresql/quickstart-create-server-database-portal.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,43 +103,25 @@ There are a number of applications you can use to connect to your Azure Database

![Azure Database for PostgreSQL - Azure Shell Bash Prompt](./media/quickstart-create-database-portal/8-bash.png)

3. At the Cloud Shell prompt, connect to a database in your Azure Database for PostgreSQL server by typing the psql command line at the green prompt.
3. At the Cloud Shell prompt, connect to your Azure Database for PostgreSQL server by typing the psql command line at the prompt. The following format is used to connect to an Azure Database for PostgreSQL server with the [psql](https://www.postgresql.org/docs/9.6/static/app-psql.html) utility:
```bash
psql --host=<myserver> --port=<port> --username=<server admin login> --dbname=<database name>
```

The following format is used to connect to an Azure Database for PostgreSQL server with the [psql](https://www.postgresql.org/docs/9.6/static/app-psql.html) utility:
```bash
psql --host=<yourserver> --port=<port> --username=<server admin login> --dbname=<database name>
```
For example, the following command connects to the default database called **postgres** on your PostgreSQL server **mypgserver-20170401.postgres.database.azure.com** using access credentials. Always use port **5432** when connecting. Enter your server admin password when prompted. Please use spaces between the --switches in the command as shown, but do not use spaces between the equal signs and the parameter values.

For example, the following command connects to an example server:

```bash
psql --host=mypgserver-20170401.postgres.database.azure.com --port=5432 --username=mylogin@mypgserver-20170401 --dbname=postgres
```

psql parameter |Suggested value|Description
---|---|---
--host | *server name* | Specify the server name value that was used when you created the Azure Database for PostgreSQL earlier. Our example server shown is mypgserver-20170401.postgres.database.azure.com. Use the fully qualified domain name (\*.postgres.database.azure.com) as shown in the example. Follow the previous section to get the connection information if you do not remember your server name.
--port | **5432** | Always use port 5432 when connecting to Azure Database for PostgreSQL.
--username | *server admin login name* |Type in the server admin login username supplied when you created the Azure Database for PostgreSQL earlier. Follow the previous section to get the connection information if you do not remember the username. The format is *username@servername*.
--dbname | **postgres** | Use the default system generated database name *postgres* for the first connection. Later you create your own database.

After running the psql command, with your own parameter values, you will be prompted to type the server admin password. This is the same password that you provided when you created the server.

psql parameter |Suggested value|Description
---|---|---
password | *your admin password* | Note, the typed password characters will not be shown on the bash prompt. Press enter after you have typed all the characters to authenticate and connect.

4. Once you're connected to the server, create a blank database at the prompt by typing the following command:
```bash
CREATE DATABASE mypgsqldb;
```
```bash
psql --host=mypgserver-20170401.postgres.database.azure.com --port=5432 --username=mylogin@mypgserver-20170401 --dbname=postgres
```
4. Once you're connected to the server, create a blank database at the prompt.
```bash
CREATE DATABASE mypgsqldb;
```

5. At the prompt, execute the following command to switch connection to the newly created database **mypgsqldb**.
```bash
\c mypgsqldb
```
6. Type \q and then press ENTER to quit psql. You can close the Azure Cloud Shell.
```bash
\c mypgsqldb
```

Now you have connected to the Azure Database for PostgreSQL and created a blank user database. Continue to the next section to connect using another common tool pgAdmin.

Expand Down

0 comments on commit 8178a59

Please sign in to comment.