Connect to Database
To see the tables of a database as a diagram, DbSchema first needs to reach the database. Choose your database type and enter the connection details. DbSchema then reads the structure of the database into a new model. The model is your DbSchema project: the tables, columns and diagrams that you see in DbSchema. DbSchema connects to more than 100 SQL and NoSQL databases, and the list of databases has setup notes for each one.
Connecting needs no license: the free Community Edition connects to every database. Connecting and reading the structure change nothing in the database.
Connect to a database for the first time
DbSchema saves each connection, so you type it in only once.
- On the Start New page of the Welcome Screen, choose Connect to Database. With a model already open, choose File → New Model instead.
- Click your database, such as PostgreSQL. Type in Search databases to find it.
- On the right, choose New Connection, or a connection that you saved before.
- Press Connect to PostgreSQL. The button names the database that you chose, and the connection dialog opens.
- Fill in the dialog, as the next section shows, and press Connect.
- In Reverse Engineer the Database, tick the schemas to load, and press Load.
A schema is a named group of tables inside a database. Reading the structure of an existing database into a model is called reverse engineering. Ticking a schema loads all its objects. Expand the schema to leave out some of its tables or other objects. After Load, DbSchema draws the tables in a new model. It copies only the structure, not the data. Saving the model to a file needs DbSchema Pro.
If your database is in the list, choose it there. You can add a database type that DbSchema doesn't know in the JDBC Drivers Manager. However, DbSchema then doesn't know the data types and the SQL of that database.
Fill in the connection dialog
The connection dialog has three tabs: Connection, Network and Driver, and Access and Model. For most databases, the Connection tab is all you need. Set Method to Standard. Then enter where the database runs, how to sign in, and which database to open.
| Field | What it sets |
|---|---|
| Connection Name | The name that DbSchema shows for this connection |
| Method | How DbSchema builds the address of the database |
| This computer, default port | The database runs on your computer, on its usual port |
| Remote computer or custom port | Shows Server Host and Port, for another computer or port |
| Server Host | The name or IP address of the computer where the database runs |
| Port | The number on which the database waits for connections |
| Database User, Password | The login defined in the database |
| Remember | Whether DbSchema saves the password on this computer |
| Database | The database to open; Create New creates one on the server |
| JDBC Driver | The driver file that DbSchema uses to talk to the database |
DbSchema downloads the JDBC driver the first time you connect. The wrench button next to it opens the JDBC Drivers Manager, where you can upload a driver yourself.
The buttons at the bottom:
- Test Connection tries the settings and tells you whether the connection works. The dialog stays open.
- Save keeps the connection and closes the dialog, without connecting.
- Connect saves the connection and connects.
- Tips & Help opens the setup notes for your database on dbschema.com.
If the password is empty, the dialog warns that "The password is empty. PostgreSQL normally requires one." For a database that needs no password, press Test anyway, or Connect anyway.
Add a connection to an open model
One model can work with several databases that have the same tables, such as a test database and a production database. DbSchema saves connections by database type. For example, any PostgreSQL model can use your saved PostgreSQL connections.
- Click the connection button in the toolbar. It shows the name of the current connection.
- Choose Add Connection. Database → Add Connection does the same.
- Choose the Method, fill in the dialog, and press Test Connection.
- Press Connect.
The connection button lists your connections. Choose one to switch the model to that database, or Offline (connect later) to work without a database. To change the current connection, choose Edit Active Connection in the same menu.
Choose a connection method
The Method list shows the ways that DbSchema can connect. They depend on your database type.
Each entry builds a JDBC URL: the address of a database in one line, such as jdbc:postgresql://127.0.0.1:55432/shopdb.
For PostgreSQL, the list is:
| Method | URL it builds |
|---|---|
| Standard | jdbc:postgresql://<HOST>[:<PORT>]/<DB> |
| Use SSL - Read 'Help & Tips' | The same, with ?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory |
| Heroku | The same, with ?sslmode=require |
| Paste a JDBC URL | The URL that you paste |
Other databases add their own entries:
- SQL Server adds Windows Authentication and Windows Authentication, Current User, which sign in with a Windows account, and Microsoft Entra ID methods.
- Snowflake adds Single Sign-On in the Browser (Okta, Entra ID, Ping), which signs in through your browser and asks for no password, and Private Key File.
- Oracle offers Connect via SID, Connect via Service Name, TNS and TNS Alias (tnsnames.ora).
With TNS Alias (tnsnames.ora), type the alias into TNS Alias.
Under SSL & Parameters, choose the folder that holds the tnsnames.ora file in TNS Admin Directory. DbSchema searches this file for the alias.
If you do not choose a folder, DbSchema uses the folder set in the TNS_ADMIN environment variable.
Paste a JDBC URL
Paste a URL when you already have one, for example from a cloud console.
- Open the Method list and choose Paste a JDBC URL, the last entry.
- Paste the URL into JDBC URL.
- Type the Database User and Password.
- Press Test Connection, then Connect.
The URL already holds the host, the port and the database. So the dialog hides their fields.
Add SSL and driver parameters
SSL encrypts the connection, and most cloud databases require it. Each driver also has settings of its own, such as timeouts. DbSchema lists them for you, so you don't write them into the URL by hand.
- Open the Network and Driver tab of the connection dialog.
- Press the pencil next to SSL & Parameters.
- Pick a group on the left, such as SSL / TLS, tick it, and choose the values.
- Press OK.
If you leave a group unticked, DbSchema adds none of its settings to the URL. The driver then uses its own defaults. Each value has a short explanation under it.
For PostgreSQL, the SSL Mode decides how strictly DbSchema checks the server:
| SSL Mode | What the driver does |
|---|---|
| Prefer | The driver default: tries SSL, uses a plain connection if SSL fails, checks no certificate |
| Require | Always encrypts, checks no certificate; the usual choice for cloud databases |
| Verify CA | Encrypts, and checks the server certificate against the CA Certificate File that you choose |
| Verify Full | Also checks that the host name matches the certificate |
| Allow | Connects without SSL first, and uses SSL only if the server requires it |
| Disable | Never uses SSL |
To see the URL that DbSchema will connect with, press the eye button next to SSL & Parameters.
The other fields of the Network and Driver tab:
| Field | What it sets |
|---|---|
| Properties | Driver settings as key1=value1;key2=value2, passed to the driver outside the URL |
| Custom Time Zone | A fixed time zone for this connection |
| Java Location | The Java that DbSchema runs on, for sign-in methods that need its certificate file |
If timestamps are off by a few hours, your computer and the server use different time zones. Tick Custom Time Zone and choose the server's time zone.
Connect through an SSH tunnel
An SSH tunnel lets you connect to a database through another server, called a jump host. You need one when only that server can reach the database. DbSchema connects to the SSH server, and the SSH server connects to the database.
- Open the Network and Driver tab of the connection dialog.
- Under SSH Tunnel, press the pencil next to Configuration.
- Press + to add a configuration.
- Type a Name, the Host of the SSH server, and its Port. The default port is 22.
- Choose how to sign in, and fill in its fields.
- Press Test Tunnel, then Close.
- Choose the new configuration in the Configuration list.
- Press Test Connection, then Connect.
| Sign-in | What it asks for |
|---|---|
| No authentication | Nothing, for a server that asks for nothing |
| Password authentication | The user and password on the SSH server |
| Public key authentication | The user, an OpenSSH, PEM or PPK (PuTTY) key file, and its passphrase |
| SSH agent authentication | The user alone; the keys stay in the running ssh-agent or Pageant |
DbSchema saves each configuration once, so several connections through the same jump host share one entry.
On the Connection tab, enter the host and port of the database as the SSH server reaches it, not as your computer reaches it.
If the database runs on the SSH server itself, that is often localhost, the name by which a computer reaches itself.
Firewall, Proxy & SSH Tunnel has more on networks.
Protect a production connection
Use the Access and Model tab to control what DbSchema and the AI may do through a connection, and to avoid changing the wrong database by mistake.
- Tick Read Only Connection for a production database. DbSchema then refuses to change the database through this connection, and asks the JDBC driver to open the connection read-only.
- Tick Allow AI tools to access this database connection to let the AI Assistant and your own AI agents use this database. They may use it only while this box is ticked. New connections start with this box unticked. AI Permissions explains what the AI may then do.
- Use Highlight to color the connection button as Production, Development or Test, so you see at once which database you're working on.
Fit the model to this database
The Model group of the same tab adapts the model to this database:
- Schema Mapping lets the model and the database use different names for a schema. You can then use the same model with several databases.
- Included Schemas lists the schemas that are ticked by default when DbSchema loads the structure from this connection. Separate the names with commas, and use
*for any text, such aspublic, auth, tenant_*.
Manage your saved connections
Choose Database → Manage Connections to see the saved connections for the database type of your current model. The connection button in the toolbar has the same entry.
| Control | What it does |
|---|---|
| Eye button | Lists the connection in the connection menu, or hides it there |
| Pencil, copy, disconnect and bin buttons | Edit, clone, disconnect or delete the connection |
| Add | Creates a connection |
| Import, Export | Reads connections from a file, or writes them to one |
| JDBC Drivers | Opens the JDBC Drivers Manager |
| Connect | Connects with the selected connection |
A badge beside the name marks a connection: AI when the AI may use it, and Production, Development or Test for a highlighted connection.
What leaves your computer when you connect?
Before you connect DbSchema to a database with real data, you want to know where that data goes.
- The JDBC driver runs inside DbSchema on your computer, and talks to the database server directly. No DbSchema server sits in between.
- Connecting reads only the structure, such as the tables, columns and keys. DbSchema reads table data only when you open a table or run a query.
- DbSchema saves the model as a
.dbsfile on your computer. - DbSchema saves a password only when you tick Remember, in a file on your computer.
- If AI access is ticked on a connection, DbSchema sends your AI provider the data that the AI reads from that database. With Ollama, which runs the AI model on your own computer, nothing leaves your computer.
We, Wise Coders, the company behind DbSchema, are ISO 27001 certified.
Common problems
Windows authentication to SQL Server fails
Choose Windows Authentication or Windows Authentication, Current User as the Method. These methods sign in with Windows only when DbSchema runs on Windows.
Windows sign-in needs Microsoft's mssql-jdbc_auth DLL.
DbSchema downloads it with the SQL Server driver, into .DbSchema\drivers\SqlServer\native-win in your home folder.
If the error says "Native SSPI library not loaded", check that this folder holds the DLL.
On Linux and macOS, sign in with Kerberos instead. Choose Windows Authentication as the Method. Then press the pencil next to SSL & Parameters on the Network and Driver tab, and choose Authentication → Integrated Security Scheme → Java Kerberos.
SQL Server 2012 says "The driver could not establish a secure connection"
An old server, such as SQL Server 2012 without its updates, offers only TLS 1.0 or TLS 1.1. TLS is the encryption of the connection, and the Java bundled with DbSchema refuses these two old versions.
The best fix is to install the latest service pack and Microsoft's TLS 1.2 update on the server. If you can't update the server, tick Edit → Settings → Network → SSL Certificates → Allow Legacy TLS Algorithms, and restart DbSchema. This setting lowers the security of every connection that DbSchema makes, so use it only for such a server.
The SSH tunnel refuses my private key
"Cannot load the private key file" means that the file isn't a private key.
Often it is the public key, such as id_ed25519.pub: choose the file with the same name and no .pub.
"Incorrect passphrase for the private key file", or "Auth cancel", means that the passphrase is missing or wrong in the SSH configuration. A passphrase is the password that protects a private key. Type it in Passphrase.
Snowflake asks for a password, but I sign in with SSO
An account that uses single sign-on (Okta, Entra ID, Ping) or MFA can't sign in with a password alone. Edit the connection and choose Single Sign-On in the Browser (Okta, Entra ID, Ping) as the Method. DbSchema then opens your browser for the sign-in.
I defined a new DBMS by mistake. How do I delete it?
DbSchema has no button for this.
Close DbSchema, then delete the folder named after that DBMS in .DbSchema/drivers, in your home folder.
Remove a driver explains the folders.