Database servers: Difference between revisions
No edit summary |
(Marked this version for translation) |
||
Line 3: | Line 3: | ||
<translate> | <translate> | ||
== Database servers available for researchers == | == Database servers available for researchers == <!--T:1--> | ||
Compute Canada offers access to MySQL and Postgres database servers for researchers: | Compute Canada offers access to MySQL and Postgres database servers for researchers: | ||
* Cedar MySQL server | * Cedar MySQL server | ||
Line 19: | Line 19: | ||
== Cedar MySQL server == | == Cedar MySQL server == <!--T:2--> | ||
<!--T:3--> | |||
The Cedar MySQL server offers MariaDB version 10.2 which is compatible with other flavours of MySQL. For information on compatibility, see https://mariadb.com/kb/en/library/mariadb-vs-mysql-compatibility/ . For information on the latest features in MariaDB version 10.2, see https://mariadb.com/resources/blog/whats-new-mariadb-server-102 . | The Cedar MySQL server offers MariaDB version 10.2 which is compatible with other flavours of MySQL. For information on compatibility, see https://mariadb.com/kb/en/library/mariadb-vs-mysql-compatibility/ . For information on the latest features in MariaDB version 10.2, see https://mariadb.com/resources/blog/whats-new-mariadb-server-102 . | ||
<!--T:4--> | |||
The Cedar MySQL MariaDB server runs as a VM called "cedar-mysql-vm" (full name: cedar-mysql-vm.int.cedar.computecanada.ca) on a database machine. | The Cedar MySQL MariaDB server runs as a VM called "cedar-mysql-vm" (full name: cedar-mysql-vm.int.cedar.computecanada.ca) on a database machine. | ||
Users who have accounts on the MySQL server are able to connect only through the Cedar headnode | Users who have accounts on the MySQL server are able to connect only through the Cedar headnode | ||
(cedar.computecanada.ca), Cedar compute nodes and cedar portal (https://gateway.cedar.computecanada.ca). | (cedar.computecanada.ca), Cedar compute nodes and cedar portal (https://gateway.cedar.computecanada.ca). | ||
<!--T:5--> | |||
For security, users cannot make an SSH connection to the database server directly. | For security, users cannot make an SSH connection to the database server directly. | ||
=== MySQL account and connection === | === MySQL account and connection === <!--T:6--> | ||
<!--T:7--> | |||
If you need the privileges to create your own database, you will need a MySQL account. To get a MySQL account on the Cedar MySQL server, please send a request to support@computecanada.ca with the following information: | If you need the privileges to create your own database, you will need a MySQL account. To get a MySQL account on the Cedar MySQL server, please send a request to support@computecanada.ca with the following information: | ||
<!--T:8--> | |||
* Your Compute Canada username | * Your Compute Canada username | ||
* Amount of database space needed for your project | * Amount of database space needed for your project | ||
<!--T:9--> | |||
We will then create an MySQL account with the same username as your computecanada username and a 16 digit random string password. The username, password, and database server name and other required information to make a MySQL connection will be stored in a file called <code>.my.cnf</code> located in your home directory on Cedar. The file is confidential and owned by root and only user can read that, e.g., user cannot modify it, however user can delete that. So, please do not delete this file. | We will then create an MySQL account with the same username as your computecanada username and a 16 digit random string password. The username, password, and database server name and other required information to make a MySQL connection will be stored in a file called <code>.my.cnf</code> located in your home directory on Cedar. The file is confidential and owned by root and only user can read that, e.g., user cannot modify it, however user can delete that. So, please do not delete this file. | ||
<!--T:10--> | |||
Command {{Command|mysql}} from cedar head node can be used to connect to the MySQL server. Please '''do not''' use the <code>-p</code> or <code>-h</code> option as an argument in running mysql. The required password and server name is this case and any other information will be automatically taken from your <code>.my.cnf</code> file if you do not use such options. | Command {{Command|mysql}} from cedar head node can be used to connect to the MySQL server. Please '''do not''' use the <code>-p</code> or <code>-h</code> option as an argument in running mysql. The required password and server name is this case and any other information will be automatically taken from your <code>.my.cnf</code> file if you do not use such options. | ||
<!--T:11--> | |||
It is acceptable to submit a long-running SQL command from the Cedar head node, as most of the CPU usage is taken from the database server side. However, if you are running a script which is issuing SQL commands and uses lots of CPU, then it needs to be submitted as a job to the scheduler. See [[Running jobs]] for details. | It is acceptable to submit a long-running SQL command from the Cedar head node, as most of the CPU usage is taken from the database server side. However, if you are running a script which is issuing SQL commands and uses lots of CPU, then it needs to be submitted as a job to the scheduler. See [[Running jobs]] for details. | ||
=== How to set up your MySQL database === | === How to set up your MySQL database === <!--T:12--> | ||
<!--T:13--> | |||
In order to be able to set up MySQL tables and query them, you need to create your own database. To create a database, the name of the database is arbitrary but it must start with "<username>_" | In order to be able to set up MySQL tables and query them, you need to create your own database. To create a database, the name of the database is arbitrary but it must start with "<username>_" | ||
<!--T:14--> | |||
where <username> is your MySQL username. For example, if your username were "david" the name of the database '''must''' start with "david_" and the commands to create a database called "david_db1", for example, would be: | where <username> is your MySQL username. For example, if your username were "david" the name of the database '''must''' start with "david_" and the commands to create a database called "david_db1", for example, would be: | ||
<!--T:15--> | |||
{{Command|mysql | {{Command|mysql | ||
mysql> CREATE DATABASE david_db1; | mysql> CREATE DATABASE david_db1; | ||
Line 53: | Line 64: | ||
}} | }} | ||
<!--T:16--> | |||
Users can create multiple MySQL databases as long as they all start with "<username>_". | Users can create multiple MySQL databases as long as they all start with "<username>_". | ||
The created databases will automatically be accessible only to you from the cedar head node, cedar compute nodes, and cedar portal (gateway.cedar.computecanada.ca) and you will have full privileges to create SQL objects such as tables, views, etc.. | The created databases will automatically be accessible only to you from the cedar head node, cedar compute nodes, and cedar portal (gateway.cedar.computecanada.ca) and you will have full privileges to create SQL objects such as tables, views, etc.. | ||
=== How to work with your MYSQL database === | === How to work with your MYSQL database === <!--T:17--> | ||
<!--T:18--> | |||
Suppose you have account "david" and have created a database called "david_db1" and want to use it. Here's how: | Suppose you have account "david" and have created a database called "david_db1" and want to use it. Here's how: | ||
<!--T:19--> | |||
{{Command|mysql | {{Command|mysql | ||
mysql> -- List available databases. Confirm david_db1 is in the list | mysql> -- List available databases. Confirm david_db1 is in the list | ||
Line 69: | Line 83: | ||
}} | }} | ||
<!--T:20--> | |||
Useful websites for information on using MariaDB: | Useful websites for information on using MariaDB: | ||
* https://mariadb.com/kb/en/ - MariaDB Knowledgebase | * https://mariadb.com/kb/en/ - MariaDB Knowledgebase | ||
Line 75: | Line 90: | ||
* https://mariadb.com/kb/en/library/optimization-and-indexes/ - MariaDB Optimization and Indexes | * https://mariadb.com/kb/en/library/optimization-and-indexes/ - MariaDB Optimization and Indexes | ||
=== MySQL connectivity for BioPerl === | === MySQL connectivity for BioPerl === <!--T:21--> | ||
BioPerl is a collection of open source Perl tools for bioinformatics, genomics and life science. | BioPerl is a collection of open source Perl tools for bioinformatics, genomics and life science. | ||
Documentation can be found at [http://bioperl.org/howtos/ bioperl.org]. | Documentation can be found at [http://bioperl.org/howtos/ bioperl.org]. | ||
<!--T:22--> | |||
There are several BioPerl modules which can be used to upload data to a database. To connect to a MySQL server from one of these, the BioPerl command line should contain the -d option as follows: | There are several BioPerl modules which can be used to upload data to a database. To connect to a MySQL server from one of these, the BioPerl command line should contain the -d option as follows: | ||
-d [database name]:mysql_read_default_file=.my.cnf .... | <!--T:23--> | ||
-d [database name]:mysql_read_default_file=.my.cnf .... | |||
=== MySQL connectivity for GBrowse === | === MySQL connectivity for GBrowse === <!--T:24--> | ||
<!--T:25--> | |||
GBrowse is a combination of database and interactive web pages for manipulating and displaying annotations on genomes. | GBrowse is a combination of database and interactive web pages for manipulating and displaying annotations on genomes. | ||
<!--T:26--> | |||
Documentation: http://gmod.org/wiki/GBrowse | Documentation: http://gmod.org/wiki/GBrowse | ||
<!--T:27--> | |||
In order to connect to MySQL from gbrowse, the corresponding line to connect to MySQL should contain: | In order to connect to MySQL from gbrowse, the corresponding line to connect to MySQL should contain: | ||
db_args = -adaptor DBI::mysql | <!--T:28--> | ||
db_args = -adaptor DBI::mysql | |||
-dsn [database name];mysql_read_default_file=/home/[username]/.my.cnf | -dsn [database name];mysql_read_default_file=/home/[username]/.my.cnf | ||
-user [username] | -user [username] | ||
<!--T:29--> | |||
where [username] is the corresponding user name and [database name] is the name of the database. | where [username] is the corresponding user name and [database name] is the name of the database. | ||
== Cedar PostgreSQL server == | == Cedar PostgreSQL server == <!--T:30--> | ||
<!--T:31--> | |||
The Cedar Postgres server offers Postgres version 10.1 along with the PostGIS extension version 2.4 . Postgres 10.1 mainly is an upgrade to correct bugs in version 10. For information on the latest features in Postgres version 10, see https://wiki.postgresql.org/wiki/New_in_postgres_10 . | The Cedar Postgres server offers Postgres version 10.1 along with the PostGIS extension version 2.4 . Postgres 10.1 mainly is an upgrade to correct bugs in version 10. For information on the latest features in Postgres version 10, see https://wiki.postgresql.org/wiki/New_in_postgres_10 . | ||
<!--T:32--> | |||
The Cedar PostgreSQL server runs as a VM called "cedar-pgsql-vm" (full name: cedar-pgsql-vm.int.cedar.computecanada.ca) on a database machine. | The Cedar PostgreSQL server runs as a VM called "cedar-pgsql-vm" (full name: cedar-pgsql-vm.int.cedar.computecanada.ca) on a database machine. | ||
Users who have accounts on the PostgreSQL server are able to connect only through the Cedar headnode | Users who have accounts on the PostgreSQL server are able to connect only through the Cedar headnode | ||
(cedar.computecanada.ca), Cedar compute nodes and Cedar portal machine. | (cedar.computecanada.ca), Cedar compute nodes and Cedar portal machine. | ||
<!--T:33--> | |||
For security, users cannot make an SSH connection to the database server directly. | For security, users cannot make an SSH connection to the database server directly. | ||
<!--T:34--> | |||
To get an account and database on the Cedar PostgreSQL server, send a request to support@computecanada.ca with the following information: | To get an account and database on the Cedar PostgreSQL server, send a request to support@computecanada.ca with the following information: | ||
* Your Compute Canada username | * Your Compute Canada username | ||
Line 112: | Line 138: | ||
* Do you need the PostGIS 2.4 extension for the database? | * Do you need the PostGIS 2.4 extension for the database? | ||
=== PostgreSQL account and connection === | === PostgreSQL account and connection === <!--T:35--> | ||
<!--T:36--> | |||
Your created PostgreSQL account will have the same username as your Compute Canada username. You will be given a database. The name of the database will typically be "db_<username>" where <username> is your Compute Canada username. Users are not able to create databases. If you need more databases please send us a request at support@computecanada.ca . PostgreSQL uses IDENT authentication for connection from cedar compute nodes which means no password is needed to be supplied to your PostgreSQL account. For security reasons your Compute Canada password is to NEVER be required or used in a script. This also means that user A from a cedar compute node cannot make a PostgreSQL connection to user B. | Your created PostgreSQL account will have the same username as your Compute Canada username. You will be given a database. The name of the database will typically be "db_<username>" where <username> is your Compute Canada username. Users are not able to create databases. If you need more databases please send us a request at support@computecanada.ca . PostgreSQL uses IDENT authentication for connection from cedar compute nodes which means no password is needed to be supplied to your PostgreSQL account. For security reasons your Compute Canada password is to NEVER be required or used in a script. This also means that user A from a cedar compute node cannot make a PostgreSQL connection to user B. | ||
Line 119: | Line 146: | ||
for a password. Your password for PostgreSQL connection is the same as your Compute Canada password for this case. Example: | for a password. Your password for PostgreSQL connection is the same as your Compute Canada password for this case. Example: | ||
<!--T:37--> | |||
{{Command|psql -h cedar-pgsql-vm -d db_[username]}} | {{Command|psql -h cedar-pgsql-vm -d db_[username]}} | ||
where db_[username] is the name of the database that was set up for you with your PostgreSQL account. (If you require | where db_[username] is the name of the database that was set up for you with your PostgreSQL account. (If you require | ||
more databases to be set up for your PostgreSQL account to use, please send a request to support@computecanada.ca). | more databases to be set up for your PostgreSQL account to use, please send a request to support@computecanada.ca). | ||
<!--T:38--> | |||
The example above runs an older version of the psql Postgres interactive client that by default is installed on all the nodes: | The example above runs an older version of the psql Postgres interactive client that by default is installed on all the nodes: | ||
<!--T:39--> | |||
{{Command|psql --version | {{Command|psql --version | ||
psql (PostgreSQL) 9.6.2}} | psql (PostgreSQL) 9.6.2}} | ||
<!--T:40--> | |||
You should load the most recent version of the psql Postgres client which will stay loaded until you log off from your session. Example: | You should load the most recent version of the psql Postgres client which will stay loaded until you log off from your session. Example: | ||
<!--T:41--> | |||
{{Command|module load postgresql}} | {{Command|module load postgresql}} | ||
<!--T:42--> | |||
{{Command|psql --version | {{Command|psql --version | ||
psql (PostgreSQL) 10.2}} | psql (PostgreSQL) 10.2}} | ||
=== How to work with your PostgreSQL database === | === How to work with your PostgreSQL database === <!--T:43--> | ||
<!--T:44--> | |||
Suppose you have account "david" and have been assigned a database called "db_david" and want to use it from the Cedar head node. Here's how: | Suppose you have account "david" and have been assigned a database called "db_david" and want to use it from the Cedar head node. Here's how: | ||
<!--T:45--> | |||
{{Command|psql -h cedar-pgsql-vm -d db_david | {{Command|psql -h cedar-pgsql-vm -d db_david | ||
Password:<-- Enter Compute Canada password | Password:<-- Enter Compute Canada password | ||
Line 148: | Line 183: | ||
}} | }} | ||
<!--T:46--> | |||
Useful websites for information on using PostgreSQL: | Useful websites for information on using PostgreSQL: | ||
* https://www.postgresql.org/docs/current/static/tutorial.html - PostgreSQL tutorials | * https://www.postgresql.org/docs/current/static/tutorial.html - PostgreSQL tutorials | ||
* https://www.postgresql.org/docs/10/static/index.html - PostgreSQL version 10 manual | * https://www.postgresql.org/docs/10/static/index.html - PostgreSQL version 10 manual | ||
=== PostgreSQL connectivity for BioPerl === | === PostgreSQL connectivity for BioPerl === <!--T:47--> | ||
<!--T:48--> | |||
To connect to Postgres from a Perl module, for example from one of [http://bioperl.org/howtos/ BioPerl] modules, the command line should contain "-a" and "-d" options as follows: | To connect to Postgres from a Perl module, for example from one of [http://bioperl.org/howtos/ BioPerl] modules, the command line should contain "-a" and "-d" options as follows: | ||
-a DBI::Pg -d dbi:Pg:dbname=[database name] .... | <!--T:49--> | ||
-a DBI::Pg -d dbi:Pg:dbname=[database name] .... | |||
<!--T:50--> | |||
where [database name] is the name of your database. | where [database name] is the name of your database. | ||
=== PostgreSQL connectivity for gbrowse === | === PostgreSQL connectivity for gbrowse === <!--T:51--> | ||
GBrowse is a combination of database and interactive web pages for manipulating and displaying annotations on genomes. | GBrowse is a combination of database and interactive web pages for manipulating and displaying annotations on genomes. | ||
<!--T:52--> | |||
Documentation: http://gmod.org/wiki/GBrowse | Documentation: http://gmod.org/wiki/GBrowse | ||
<!--T:53--> | |||
In order to connect to postres from gbrowse, the corresponding line in the configuration | In order to connect to postres from gbrowse, the corresponding line in the configuration | ||
file should contain: | file should contain: | ||
db_args = -dsn dbi:Pg:dbname=[database name ] | <!--T:54--> | ||
db_args = -dsn dbi:Pg:dbname=[database name ] | |||
-user [username] | -user [username] | ||
</translate> | </translate> |
Revision as of 19:48, 29 March 2018
Database servers available for researchers
Compute Canada offers access to MySQL and Postgres database servers for researchers:
- Cedar MySQL server
- Description: General purpose server for the researcher wanting to set up SQL tables in MySQL and issue SQL commands against them.
- Server name: cedar-mysql-vm.int.cedar.computecanada.ca
- Short server name: cedar-mysql-vm (can be used instead of long name on most compute nodes)
- Version: MariaDB version 10.2 Community Edition
- Documentation: http://www.mariadb.com
- Cedar Postgres server
- Description: General purpose server for the researcher wanting to set up SQL tables in MySQL and issue SQL commands against them. Includes a PostGIS extension available for those needing to do geocoding.
- Server name: cedar-pgsql-vm.int.cedar.computecanada.ca
- Short server name: cedar-pgsql-vm (can be used instead of long name on most compute nodes)
- Version: PostgreSQL version 10.1, PostGIS version 2.4 extension available
- Documentation: https://www.postgresql.org and https://postgis.net/documentation
Cedar MySQL server
The Cedar MySQL server offers MariaDB version 10.2 which is compatible with other flavours of MySQL. For information on compatibility, see https://mariadb.com/kb/en/library/mariadb-vs-mysql-compatibility/ . For information on the latest features in MariaDB version 10.2, see https://mariadb.com/resources/blog/whats-new-mariadb-server-102 .
The Cedar MySQL MariaDB server runs as a VM called "cedar-mysql-vm" (full name: cedar-mysql-vm.int.cedar.computecanada.ca) on a database machine. Users who have accounts on the MySQL server are able to connect only through the Cedar headnode (cedar.computecanada.ca), Cedar compute nodes and cedar portal (https://gateway.cedar.computecanada.ca).
For security, users cannot make an SSH connection to the database server directly.
MySQL account and connection
If you need the privileges to create your own database, you will need a MySQL account. To get a MySQL account on the Cedar MySQL server, please send a request to support@computecanada.ca with the following information:
- Your Compute Canada username
- Amount of database space needed for your project
We will then create an MySQL account with the same username as your computecanada username and a 16 digit random string password. The username, password, and database server name and other required information to make a MySQL connection will be stored in a file called .my.cnf
located in your home directory on Cedar. The file is confidential and owned by root and only user can read that, e.g., user cannot modify it, however user can delete that. So, please do not delete this file.
Command
[name@server ~]$ mysql
from cedar head node can be used to connect to the MySQL server. Please do not use the -p
or -h
option as an argument in running mysql. The required password and server name is this case and any other information will be automatically taken from your .my.cnf
file if you do not use such options.
It is acceptable to submit a long-running SQL command from the Cedar head node, as most of the CPU usage is taken from the database server side. However, if you are running a script which is issuing SQL commands and uses lots of CPU, then it needs to be submitted as a job to the scheduler. See Running jobs for details.
How to set up your MySQL database
In order to be able to set up MySQL tables and query them, you need to create your own database. To create a database, the name of the database is arbitrary but it must start with "<username>_"
where <username> is your MySQL username. For example, if your username were "david" the name of the database must start with "david_" and the commands to create a database called "david_db1", for example, would be:
[name@server ~]$ mysql
mysql> CREATE DATABASE david_db1;
mysql> quit
Users can create multiple MySQL databases as long as they all start with "<username>_". The created databases will automatically be accessible only to you from the cedar head node, cedar compute nodes, and cedar portal (gateway.cedar.computecanada.ca) and you will have full privileges to create SQL objects such as tables, views, etc..
How to work with your MYSQL database
Suppose you have account "david" and have created a database called "david_db1" and want to use it. Here's how:
[name@server ~]$ mysql
mysql> -- List available databases. Confirm david_db1 is in the list
mysql> SHOW DATABASES;
mysql> -- Get into the database
mysql> USE david_db1;
mysql> ... Issue SQL commands. See below for information.
mysql> quit
Useful websites for information on using MariaDB:
- https://mariadb.com/kb/en/ - MariaDB Knowledgebase
- https://mariadb.com/kb/en/library/training-tutorials/ - MariaDB Training and Tutorials
- https://mariadb.com/kb/en/library/sql-statements-structure/ - MariaDB SQL Statement Structure
- https://mariadb.com/kb/en/library/optimization-and-indexes/ - MariaDB Optimization and Indexes
MySQL connectivity for BioPerl
BioPerl is a collection of open source Perl tools for bioinformatics, genomics and life science. Documentation can be found at bioperl.org.
There are several BioPerl modules which can be used to upload data to a database. To connect to a MySQL server from one of these, the BioPerl command line should contain the -d option as follows:
-d [database name]:mysql_read_default_file=.my.cnf ....
MySQL connectivity for GBrowse
GBrowse is a combination of database and interactive web pages for manipulating and displaying annotations on genomes.
Documentation: http://gmod.org/wiki/GBrowse
In order to connect to MySQL from gbrowse, the corresponding line to connect to MySQL should contain:
db_args = -adaptor DBI::mysql -dsn [database name];mysql_read_default_file=/home/[username]/.my.cnf -user [username]
where [username] is the corresponding user name and [database name] is the name of the database.
Cedar PostgreSQL server
The Cedar Postgres server offers Postgres version 10.1 along with the PostGIS extension version 2.4 . Postgres 10.1 mainly is an upgrade to correct bugs in version 10. For information on the latest features in Postgres version 10, see https://wiki.postgresql.org/wiki/New_in_postgres_10 .
The Cedar PostgreSQL server runs as a VM called "cedar-pgsql-vm" (full name: cedar-pgsql-vm.int.cedar.computecanada.ca) on a database machine. Users who have accounts on the PostgreSQL server are able to connect only through the Cedar headnode (cedar.computecanada.ca), Cedar compute nodes and Cedar portal machine.
For security, users cannot make an SSH connection to the database server directly.
To get an account and database on the Cedar PostgreSQL server, send a request to support@computecanada.ca with the following information:
- Your Compute Canada username
- Amount of database space needed for your project
- Do you need the PostGIS 2.4 extension for the database?
PostgreSQL account and connection
Your created PostgreSQL account will have the same username as your Compute Canada username. You will be given a database. The name of the database will typically be "db_<username>" where <username> is your Compute Canada username. Users are not able to create databases. If you need more databases please send us a request at support@computecanada.ca . PostgreSQL uses IDENT authentication for connection from cedar compute nodes which means no password is needed to be supplied to your PostgreSQL account. For security reasons your Compute Canada password is to NEVER be required or used in a script. This also means that user A from a cedar compute node cannot make a PostgreSQL connection to user B.
When access is from the head node, however, PostgreSQL uses PAM authentication which means that you will be prompted for a password. Your password for PostgreSQL connection is the same as your Compute Canada password for this case. Example:
[name@server ~]$ psql -h cedar-pgsql-vm -d db_[username]
where db_[username] is the name of the database that was set up for you with your PostgreSQL account. (If you require more databases to be set up for your PostgreSQL account to use, please send a request to support@computecanada.ca).
The example above runs an older version of the psql Postgres interactive client that by default is installed on all the nodes:
[name@server ~]$ psql --version
psql (PostgreSQL) 9.6.2
You should load the most recent version of the psql Postgres client which will stay loaded until you log off from your session. Example:
[name@server ~]$ module load postgresql
[name@server ~]$ psql --version
psql (PostgreSQL) 10.2
How to work with your PostgreSQL database
Suppose you have account "david" and have been assigned a database called "db_david" and want to use it from the Cedar head node. Here's how:
[name@server ~]$ psql -h cedar-pgsql-vm -d db_david
Password:<-- Enter Compute Canada password
db_david=> -- List names of tables in your database
db_david=> \l
db_david=> ... Issue SQL commands. See below for information.
db_david=> -- Quit
db_david=> \q
Useful websites for information on using PostgreSQL:
- https://www.postgresql.org/docs/current/static/tutorial.html - PostgreSQL tutorials
- https://www.postgresql.org/docs/10/static/index.html - PostgreSQL version 10 manual
PostgreSQL connectivity for BioPerl
To connect to Postgres from a Perl module, for example from one of BioPerl modules, the command line should contain "-a" and "-d" options as follows:
-a DBI::Pg -d dbi:Pg:dbname=[database name] ....
where [database name] is the name of your database.
PostgreSQL connectivity for gbrowse
GBrowse is a combination of database and interactive web pages for manipulating and displaying annotations on genomes.
Documentation: http://gmod.org/wiki/GBrowse
In order to connect to postres from gbrowse, the corresponding line in the configuration file should contain:
db_args = -dsn dbi:Pg:dbname=[database name ] -user [username]