Skip to content
Guide · DBeaver

How to Connect DBeaver to MySQL

A DBeaver MySQL connection needs the right driver for your server version, the host, port, database and an account that is allowed to connect from your machine. This guide follows DBeaver's documented wizard and explains the MySQL 8.4 authentication and network settings behind the usual errors.

Steps and facts checked 8 October 2026 against the vendor's official documentation. Versions covered: DBeaver Community 26.2.2; MySQL 8.4 LTS. Next review due April 2027. Menus, shortcuts and prices change between releases; check the vendor's documentation for your version.
Short answer
  • Pick the MySQL driver for MySQL 8 and later; DBeaver also offers MySQL 5 for 5.x servers and MySQL (old) for 4.x and earlier.
  • Enter Host, Port (default 3306), Database, user and password on the Main tab, then select Test Connection and Finish.
  • MySQL 8.4 accounts use caching_sha2_password by default, which needs either an encrypted connection or RSA public key exchange; DBeaver exposes Allow public key retrieval in its SSL settings.
  • "Access denied" and "Host ... is not allowed to connect" are account problems on the server; "Can't connect" usually means the server, port, bind address or firewall.
How we know: Research-based: connection steps and fields were checked against the DBeaver documentation (Create connection, MySQL, SSH configuration, SSL configuration), and server behaviour and driver properties against the MySQL 8.4 Reference Manual and the MySQL Connector/J documentation on 8 October 2026. We have not made these connections for this guide; labels are quoted from DBeaver's documentation and can change between versions.

Choose the right MySQL driver

DBeaver's MySQL documentation says it supports all MySQL versions, but the correct driver must be selected: MySQL for version 8 and later, MySQL 5 for 5.x and MySQL (old) for 4.x and earlier. Related products have their own entries, including NDB Cluster, OceanBase, TiDB and a Google Cloud SQL (MySQL) driver. For MariaDB servers, choose the separate MariaDB driver in the list.

DBeaver manages the driver files for you. To see which driver version a connection uses, edit the connection and select Test Connection; the result shows it. To update it, open Driver Settings, then the Libraries tab, and use Download/Update.

Create the DBeaver MySQL connection

  1. Select the New Connection Wizard button in the toolbar or the Connections view, or press Ctrl+Shift+N.
  2. Select MySQL and select Next.
  3. Leave Connect by set to Host and enter the Host, Port (3306 by default) and, optionally, Database. Tick Show all databases if you want every database you can access in the tree; otherwise only the database named in the connection is shown.
  4. Choose the authentication method and enter the user name and password. DBeaver also documents two-factor, Kerberos and cloud IAM options for MySQL.
  5. If the server and your machine are in different time zones, set Server Time Zone, which determines the time zone DBeaver uses for the server.
  6. Select Test Connection, then Finish.

Once saved, the connection appears in the Connections tree, where you can open a SQL editor, browse tables and import CSV files.

SSH tunnel, SSL and public key retrieval

SSH tunnel. If MySQL only accepts local connections or sits behind a firewall, tunnel through SSH. In the connection dialog, select the plus button and choose SSH, enter the SSH Host/IP, Port (22 by default), User name and an authentication method (Password, Public Key or Agent), and select Test tunnel configuration. DBeaver's SSH guide says to set the host on the Main tab to localhost, which matches a MySQL server running on the SSH host. Connections by URL need manual port forwarding in the tunnel's advanced settings.

SSL. Select the plus button and choose SSL to set a CA certificate, client certificate and key, and options such as Verify server certificate. Connector/J, the MySQL JDBC driver, uses sslMode=PREFERRED by default: it encrypts when the server supports it and otherwise falls back to an unencrypted connection. Choose a stricter mode, such as VERIFY_IDENTITY, through driver properties when you need guaranteed, verified encryption.

Public key retrieval. In MySQL 8.4, caching_sha2_password is the default authentication plugin. The MySQL manual says an account using it must connect over a secure connection or an unencrypted connection that exchanges the password using an RSA key pair. Connector/J does not fetch the server's RSA public key unless allowPublicKeyRetrieval is true (the default is false), so an unencrypted first login can fail with an error about public key retrieval. DBeaver lists Allow public key retrieval among its SSL tab options; enabling SSL is the more secure fix.

Fixing common DBeaver MySQL connection errors

The MySQL 8.4 manual's troubleshooting chapter covers the errors DBeaver passes through from the server:

  • Can't connect to MySQL server on 'host_name'. Check the server is running and that you are using the right port. The manual notes that a server started with skip_networking accepts no TCP/IP connections, and one with bind_address set to 127.0.0.1 accepts only local connections. Also check firewalls for port 3306.
  • Access denied for user ... Wrong user name or password, or the account exists for a different host.
  • Host ... is not allowed to connect to this MySQL server. There is no account whose host part matches your client. Create one for your user and client address (a pattern with % matches several hosts), as in the example below.
MySQL 8.4: create an account for one client subnet and grant it access to one database (run as an administrator)
CREATE USER 'appuser'@'192.168.1.%' IDENTIFIED BY '<your-password>';
GRANT SELECT, INSERT, UPDATE, DELETE ON mydb.* TO 'appuser'@'192.168.1.%';

Frequently asked questions

What is the default MySQL port in DBeaver?

3306, the standard MySQL port. Change it on the Main tab if your server listens on another port.

Should I use the MySQL or MariaDB driver for MariaDB?

Use the MariaDB entry in DBeaver's driver list for MariaDB servers, and the MySQL driver for MySQL 8 and later.

How do I fix a public key retrieval error in DBeaver?

The account uses caching_sha2_password and the connection is not encrypted. Prefer configuring SSL for the connection; alternatively enable Allow public key retrieval in the connection settings, which lets the driver request the server's RSA public key.

Can DBeaver connect to MySQL on a remote server without opening port 3306?

Yes. Use an SSH tunnel to a server that can reach MySQL; only the SSH port needs to be reachable from your machine.

Why does DBeaver show only one MySQL database?

If Show all databases is not ticked, DBeaver shows only the database named in the connection. Tick the option on the Main tab to see all databases your account can access.

Sources

Checked 8 October 2026.

How we research tool guides: our editorial method. CodeWithSQL earns nothing from the vendors mentioned.

Still choosing a SQL client?

Read the full reviews, or compare tools side by side.