How to create a database connection in DBeaver

Before you can start writing queries in DBeaver, you’ll need to create a connection to your database. DBeaver provides a wizard to walk you through this process, making it easy even for first-time users. Today, we will walk you through all these steps to show you how to use DBeaver to effortlessly establish a database connection.

To open a wizard, click on the plug icon in the upper left corner of the application window or go to Database -> New Database Сonnection. The database selection window will open and you will see a list from which you can choose the driver you need.

You have a large selection of databases to connect to. Pay attention to the tabs on the left side of the window. Click on them to choose All, Popular, SQL, NoSQL, Analytical databases, etc. The Popular tab includes the database drivers you use most regularly.

You can use these tabs for easy navigation or just type the first few characters of the database driver’s name into the search box. If you cannot find a driver for your database in the list, you can add it manually using a JDBC-driver that is compatible with your database.

Set up a database connection in DBeaver

Let’s take PostgreSQL as an example. The connection process is very similar to that of other relational databases supported by DBeaver.

1. Click on the PostgreSQL driver in the Connection Wizard. The connection settings window will open. Let’s take a look at the most important points.

2. On the main tab, you need to set all primary connection settings. For most drivers, the required settings include Host, Port, Database name, Username, and Password. But it should be noted that the number of properties depends directly on the driver.

3. Each driver has its own set of additional properties, which you can view and configure by opening the corresponding tab. In the lower right part of the window, you can see a link to the driver documentation. Click on it to get information about available properties and their values. Please note that this option is not available for all drivers.

4. If your database cannot be accessed directly, you can use an SSH tunnel. All settings are available on the corresponding tab. Our app supports the following authentication methods: user/password, public key authentication, and agent authentication. For more information about SSH configuration visit DBeaver Documentation.

5. Some databases require an additional configuration to connect like SSL or Proxy. All of these can be set in DBeaver using the appropriate tabs. You can just open the tab and enter all required properties.

6. To check that all settings are entered correctly, click Test Connection. This step can be especially relevant when creating connections with a lot of preferences. Thanks to it, you will not need to worry about possible mistakes.

You will see a dialog with all information about the driver. After completing all the settings, click the Finish button. The connection appears in the tree of connections in the Database Navigator and DBeaver actually connects to the database.

If the driver is not pre-configured in DBeaver

With DBeaver, you can not only use a pre-configured database driver but also create a new one based on the JDBC driver. To do that, go to Database -> Driver Manager. Click the New button and create a driver. On the driver edit dialog, you need to enter all required information and click the OK button. You can find more information about creating drivers in our Wiki.

If you cannot find your particular database in the list but you know it is based on other well-known database or compatible with some existing driver (for example, old Postgres driver), feel free to use this driver to create a connection.

If you want to connect DBeaver to other databases like Oracle, MySQL or Redshift, it may require setting additional parameters. To find more tutorials on different types of database connections, explore the connections section of our blog.

How to create a database connection in DBeaver: video version

 

FAQ about connections in DBeaver

If you get this error, there are three simple ways to associate your SQL script with the correct connection:

– Go to SQL Script in the main menu and choose 'Set active connection'
– Find the database icon with the 'N/A' text above your editor, click on it, and choose your connection from the list
– Go to Window -> Project Explorer, find your script in the list, right-click on it, and choose 'Associate with data source'

To change your connection settings, use the context menu and go to 'Edit Connection'. With the Advanced Settings tab, you can apply additional options to fine-tune your connection. Here's what you can configure: DBeaver advanced connection settings

You can learn about how to easily connect to Oracle in DBeaver from our Wiki: DBeaver Documentation for Oracle


Author: