Connect to a database
Connecting to a database works the same for MySQL and PostgreSQL
All the details needed to connect to a database are shown on the specific database's overview page in the control panel.

The connection string shown in the overview can be used directly in most programs and programming languages. However, some tools instead require separate values for hostname, port, username, and password. These values can be extracted from the connection string.
For example, given the following connection string:
The database type is PostgreSQL.
The username is dbadmin.
The password is xxxyyy.
The hostname is db-4f959.database-v1.glesys.com (after the @ symbol).
The port is 5432 (the default port for PostgreSQL).
The database name is defaultdb.
The connection requires SSL encryption, as indicated by the
ssl-mode=requiredparameter.
Example with DBeaver
After launching the DBeaver application, either click Database → New Database Connection from the menu or press Shift+Ctrl+N on the keyboard. This opens the dialog for creating a new database connection.
First, select the type of database—either MySQL or PostgreSQL. In this example, we want to connect to a PostgreSQL database. Click PostgreSQL, then click Next. (The procedure is pretty much the same for MySQL.)

In the next dialog box, enter all the necessary information for the database connection, such as hostname, port, database name, username, and password.

Once you’ve filled in all the required information on the Main tab, click the SSL tab. Here, check Use SSL. Under SSL mode, select require. Finally, click Finish.

Now, click the down-arrow icon in front of defaultdb under Connections. DBeaver should now connect to the database. You can then continue expanding the tree by clicking the down arrows until you see the defaultdb database and its contents.

From here, you can start working with your database—either by using the SQL console (SQL Editor → Open SQL Console) or by using the graphical interface to create and modify tables.
For example, if you expand Schemas, then public, and right-click on Tables, you can create new tables or view existing ones.
Last updated
Was this helpful?