Free & open source · Windows, macOS, Linux

Connect a database with DBeaver

DBeaver is a database management tool — a free, open-source desktop app for connecting to a database, browsing its tables, and running SQL. This guide installs it and points it at the LearnSQL sample databases, on SQL Server or MySQL.

What is DBeaver?

A database doesn't come with a screen. It's a program running on a server, waiting to be asked questions — so you need a client to talk to it. That's all a database management tool is: the window onto your data.

DBeaver is the most popular free one. In plain terms:

🤔 Do I actually need it?

Not to learn — the browser-based SQL Editor on this site needs no install and no login. Install DBeaver when you want to work like a professional does: multiple databases side by side, bigger result sets, saved scripts, and exports. For pulling data into spreadsheets instead, see Connect Excel.

On this page

Install DBeaver

DBeaver Community Edition is free and open source — there's no trial, account, or licence to buy. It's the same tool a lot of professional data folks use day to day.

  1. Go to dbeaver.io/download and grab the Community Edition installer for your operating system (Windows, macOS — Intel or Apple Silicon — or Linux).
  2. Run the installer and accept the defaults.
  3. Launch DBeaver. If it offers to create a sample SQLite database, you can skip it.

💡 About database drivers

DBeaver doesn't ship the database drivers — it downloads them the first time you connect to a new database type. When it prompts you with “Download driver files”, click Download. That's expected and only happens once per driver.

Connection details

Direct database access is read-only and uses a login that comes with your CPE Today enrollment — the same credentials as the Excel/ODBC guide, so if you've already got them you're set.

🔑 Getting your username & password

The direct-connection credentials are included — at no extra cost — with any CPE Today database or Excel course. Enroll once and you'll receive the server login, plus guided lessons that walk you through it step by step.

Get access with a CPE Today course →

No login yet? You can still practise for free right now in the browser-based SQL Editor, or read the open Web API — neither needs credentials.

🗄️ SQL Server (recommended)

Hostlearnsql.cpetoday.com
Port1433
AuthenticationSQL Server login (not Windows)
Username & passwordIncluded with your CPE Today course

Databases available:

adventureworks classicmodels contoso dvdrental northwind qbd qbo sage100 world xtreme

🐬 MySQL / MariaDB

Hostlearnsql.cpetoday.com
Port3306
AuthenticationMySQL native login
Username & passwordIncluded with your CPE Today course

Databases available:

acme adventureworks classicmodels contoso dvdrental northwind world

⚠️ Type your password carefully

This server automatically blocks IP addresses after repeated failed logins (it doubles as a security honeypot). If you mistype your password several times you may be temporarily blocked from the whole server — so paste it rather than retyping it from memory.

Connect to SQL Server

  1. In DBeaver, choose Database → New Database Connection (or the plug icon in the top-left toolbar).
  2. Pick SQL Server from the list and click Next.
  3. Fill in the Main tab:
    • Host: learnsql.cpetoday.com
    • Port: 1433
    • Database: northwind (or any database from the list above)
    • Authentication: SQL Server Authentication
    • Username / Password: the login from your CPE Today course (tick Save password so you don't retype it — see the lockout warning above)
  4. The server uses a self-signed certificate, so tell the driver to trust it. On the Driver properties tab set:
    • trustServerCertificatetrue
    Leaving this unset is the single most common cause of a failed first connection.
  5. Click Test Connection…. If DBeaver asks to download the driver files, click Download. You want to see “Connected”.
  6. Click Finish. Your connection appears in the Database Navigator on the left — expand it to browse schemas, tables and columns.

Connect to MySQL

Same flow, different driver — useful because MySQL syntax is a little friendlier for beginners (and it's what the browser SQL Editor defaults to).

  1. Database → New Database Connection → choose MySQLNext.
  2. Fill in the Main tab:
    • Server Host: learnsql.cpetoday.com
    • Port: 3306
    • Database: classicmodels (or any from the list above)
    • Username / Password: your CPE Today course login
  3. Click Test Connection…, download the driver if prompted, then Finish.

If the connection is refused with a key or SSL error, see Troubleshooting below.

Run your first query

  1. Click your connection in the Database Navigator to select it.
  2. Open a SQL editor: SQL Editor → New SQL Script (Ctrl+], or +] on macOS).
  3. Type a query and run it with Ctrl+Enter (+Enter on macOS):
SELECT TOP 10 CompanyName, City, Country
FROM Customers
ORDER BY Country;

That's SQL Server syntax. On MySQL, use LIMIT 10 at the end instead of SELECT TOP 10.

Double-clicking any table in the navigator opens it too — the Data tab shows rows and the ER Diagram tab draws the relationships for you. Want to know what each database contains first? Browse the schema explorer.

📝 Want queries worth pasting in?

We've put together ten levels of real, working SQL — from a single-table SELECT up through five-table joins, subqueries, CTEs and window functions. Every one runs as-is against classicmodels, in either dialect. Browse the sample queries →

Troubleshooting

SQL Server: “The driver could not establish a secure connection”

The certificate isn't trusted yet. On the connection's Driver properties tab set trustServerCertificate to true, then test again. (Recent Microsoft drivers encrypt by default and reject self-signed certificates unless you tell them not to.)

MySQL: “Public Key Retrieval is not allowed”

Add allowPublicKeyRetrieval=true on the Driver properties tab. If you also see an SSL complaint, set useSSL to false — this is a public teaching server with read-only sample data, so there's nothing sensitive in transit.

Login failed / connection suddenly refused

Repeated failed logins get your IP temporarily blocked server-wide (see the warning above). Wait it out, double-check the credentials from your course, and paste rather than retype.

“Cannot open database … requested by the login”

The database name is misspelled, or you're pointing at one that isn't on that engine — check the lists in Connection details (they differ between SQL Server and MySQL).

Everything is read-only

That's by design — the login can't write. To practise INSERT, UPDATE and DELETE, use the Sandbox mode in the browser SQL Editor; it gives you a private copy you can change freely.

Where to next