How to Use DBeaver to Manage Databases in ServBay
ServBay is a comprehensive local web development environment that provides developers with multiple commonly used database services. While ServBay includes web-based database management tools such as phpMyAdmin (for MySQL/MariaDB), pgAdmin (for PostgreSQL), and Redis Commander (for Redis), many developers prefer using more powerful, unified desktop clients for database management. DBeaver is one of the most popular cross-platform database clients that meets these needs.
This guide will walk you through connecting to and managing the integrated databases in ServBay—including MariaDB/MySQL, PostgreSQL, SQLite, and Redis—using DBeaver.
What Is DBeaver?
DBeaver is a free, open-source universal database tool for developers, SQL programmers, database administrators, and analysts. It supports nearly all mainstream database systems, including relational databases (such as MySQL, PostgreSQL, Oracle, SQL Server, SQLite, and others) and NoSQL databases (such as MongoDB, Redis, Cassandra, etc.).
Key features of DBeaver include:
- Broad Database Support: Manage various types of databases through a unified interface.
- User-Friendly UI: Intuitive graphical interface that simplifies complex database operations.
- Powerful Functionality: Includes features like SQL editor, data editor, metadata browser, ER diagram generation, data import/export, and many advanced operations.
- Cross-Platform: Supports Windows, macOS, and Linux operating systems.
- Active Community & Continuous Updates: Ensures ongoing stability and feature enhancements.
For ServBay users, combining ServBay with DBeaver delivers a more professional and unified database management experience, especially when handling multiple database types or executing complex queries and operations.
Managing MariaDB/MySQL Databases in ServBay with DBeaver
ServBay by default integrates MariaDB, which is highly compatible with MySQL. Here's how to connect to and manage MariaDB/MySQL databases in ServBay using DBeaver.
Prerequisites
- ServBay is installed and running.
- The MariaDB/MySQL package is started in ServBay.
- DBeaver client is downloaded and installed. You can obtain the latest version from the DBeaver Official Website.
Connecting to MariaDB/MySQL
- Launch DBeaver.
- Click the “New Database Connection” button in the top left (usually a plug icon).
- In the list of database types, search for and select “MariaDB” or “MySQL”. Click “Next.”
- Enter your connection details:
- Host:
127.0.0.1(orlocalhost) - Port:
3306 - Username: Default is
root. - Password: You can find the MariaDB/MySQL root password in ServBay's Database tab.
- Database: You can leave this blank at first; select or create a database after connecting.
- Connection Method (Optional): Besides using TCP/IP (host + port), you can choose to connect via Socket, which is often more efficient for local connections. In Driver properties, find
connectUsingand set it tosocket, then find thesocketproperty and set its value to the path of ServBay's MariaDB/MySQL socket file, which by default is/Applications/ServBay/tmp/mysql.sock. Note: When using socket connection, you generally don't need to fill in host and port.
- Host:
- Click “Test Connection” to confirm your settings. If the test fails, check that MariaDB is running in ServBay and verify your username and password. If you forget the password, you can reset the MariaDB/MySQL root password in ServBay's Database tab.
- Once the test succeeds, click “Finish” to save the connection.
Basic Database Operations
After connecting, you’ll see the MariaDB/MySQL database instance in DBeaver’s database navigator. You can perform these common operations:
- Create a Database: Right-click the connection name, select “SQL Editor” → “New SQL Script.” Enter
CREATE DATABASE mydatabase_servbay;(replacemydatabase_servbaywith your desired name), then click the execute button (green triangle). - Query Data with SQL Editor: Right-click the connection or a specific database/table, select “SQL Editor” → “New SQL Script.” Enter your SQL query, for example
SELECT * FROM your_table_name;, then execute. - Browse & Edit Data: Expand the database and tables in the navigator, double-click a table to open a tab where you can view and edit its data. DBeaver provides an intuitive data editing UI.
- Create, Modify, or Delete Tables: Right-click the “Tables” node under your database and select “Create New Table.” You can also right-click existing tables for modification or deletion.
- Import/Export Data: DBeaver supports various formats for data import and export, making data migration easy.
These operations are typically performed via DBeaver’s graphical interface or its built-in SQL editor, similar to working with other database types.
Managing PostgreSQL Databases in ServBay with DBeaver
ServBay also integrates PostgreSQL. Here’s how to connect to and manage PostgreSQL databases in ServBay using DBeaver.
Prerequisites
- ServBay is installed and running.
- The PostgreSQL package is started in ServBay.
- DBeaver client is installed.
Connecting to PostgreSQL
- Launch DBeaver.
- Click the “New Database Connection” button at the top left.
- In the database type list, search for and select “PostgreSQL.” Click “Next.”
- Enter your connection details:
- Host:
127.0.0.1(orlocalhost) - Port:
5432(default for PostgreSQL) - Database: Default is
postgres. You may also connect to other PostgreSQL databases created in ServBay. - Username: Default is
servbay. - Password: Find the PostgreSQL user password in ServBay's Database tab.
- Connection Method (Optional): Like MariaDB/MySQL, you may use Socket connection. In Driver properties, look for
socketFactoryor similar and configure the socket file path, default is/Applications/ServBay/tmp/.s.PGSQL.5432(if it fails, try/Applications/ServBay/tmp). Exact configuration details may vary by DBeaver version; usually found in advanced connection settings. When using socket connection, host and port fields are typically not required.
- Host:
- Click “Test Connection.” If connection fails, check if PostgreSQL is running in ServBay and verify your username and password. If you forget the password, you can reset it in ServBay’s Database tab.
- Once the test succeeds, click “Finish” to save the connection.
Basic Database Operations
After connecting, you’ll see the PostgreSQL database instance in DBeaver’s database navigator. Most core relational database tasks—creating databases, creating tables, running queries, editing data, importing/exporting—can be done in DBeaver similarly to MariaDB/MySQL, using the SQL editor or graphical interface.
Managing SQLite 3 Databases in ServBay with DBeaver
ServBay also provides built-in support for SQLite 3. SQLite is a lightweight, file-based database engine that doesn’t require a standalone server process.
Prerequisites
- ServBay is installed and running.
- DBeaver client is installed.
- You need a SQLite database file (
.db,.sqlite,.sqlite3, etc.). If you don’t have one, DBeaver can create it for you when setting up a new connection.
Connecting to SQLite
- Launch DBeaver.
- Click the “New Database Connection” button at the top left.
- In the database type list, search for and select “SQLite.” Click “Next.”
- Enter your connection details:
- Database File Path: Click the folder icon to select or enter the full path to your SQLite database file. ServBay recommends storing these files under
/Applications/ServBay/db/sqlite/for easier management and backup. - If the file doesn't exist yet, you can enter your chosen file path and name, and DBeaver will create it automatically.
- Database File Path: Click the folder icon to select or enter the full path to your SQLite database file. ServBay recommends storing these files under
- Click “Test Connection.” If the file path is correct and accessible, connection should succeed.
- Once the test succeeds, click “Finish” to save the connection.
Basic Database Operations (SQLite)
Once connected to your SQLite file, you can manage it in DBeaver much like any other database type, although SQLite’s feature set is relatively simple.
- Create Table: Right-click the database connection name and select “Create New Table.”
- Use SQL Editor: Right-click the connection name and choose “SQL Editor” → “New SQL Script,” then enter and run SQL statements.
- Browse & Edit Data: Double-click table names to view and edit data.
- Delete Table: Right-click a table name and select “Delete.”
- Delete Database: An SQLite database is simply a file—deleting the
.dbfile from your filesystem removes the database.
Managing Redis Databases in ServBay with DBeaver
Redis is an open-source in-memory data structure store that can function as a database, cache, and message broker. ServBay has Redis integrated by default.
Prerequisites
- ServBay is installed and running.
- The Redis package is started in ServBay.
- DBeaver client is installed.
Connecting to Redis
- Launch DBeaver.
- Click the “New Database Connection” button at the top left.
- In the database type list, search for and select “Redis.” Click “Next.”
- Enter your connection details:
- Host:
127.0.0.1(orlocalhost) - Port:
6379(Redis default port) - Password: By default, ServBay’s Redis installation has no password—leave blank. If you’ve set a Redis password in ServBay, enter it here.
- Host:
- Click “Test Connection.” If it fails, check that Redis is running in ServBay and verify the port and password.
- Once the test succeeds, click “Finish” to save the connection.
Basic Data Management (Redis)
Once connected, DBeaver provides a graphical interface to browse and manage key-value pairs in Redis.
- View Keys: Expand the connection in the database navigator, select a database (usually
DB 0), and you’ll see a key list. - Add Keys: Right-click the database node or the blank space in the key list, select “New Key.” Enter a key name, select the key type (String, List, Set, Hash, ZSet, etc.), and enter the value.
- Edit Keys: Double-click or right-click an existing key, select “Edit Key” to modify its value or TTL (Time To Live).
- Delete Keys: Right-click a key and choose “Delete Key.”
- Use Redis Console: Right-click the connection name or database, select “SQL Editor” → “New Redis Console,” to enter and execute Redis commands directly.
Frequently Asked Questions & Troubleshooting (FAQ)
- Connection fails with “Connection Refused”:
- Make sure ServBay is running.
- Check that the database service you're connecting to (MariaDB/MySQL, PostgreSQL, Redis) is started and displays as green (active) in ServBay.
- Confirm that the host and port in your connection settings are correct. For local connections, typically use
127.0.0.1and the default ports (MariaDB/MySQL: 3306, PostgreSQL: 5432, Redis: 6379). - If using a socket connection, verify the socket file path is correct and the database service is set up to use that socket.
- Check your firewall settings to ensure DBeaver can communicate with local ports.
- Connected but authentication fails:
- Double-check the username and password you entered. You can find or reset the root/default user password for databases in ServBay's Database tab.
- SQLite file path issues when connecting:
- Ensure the file path you entered is complete and correct.
- Make sure DBeaver has read/write permissions for the specified file path.
- DBeaver interface issues or incomplete display:
- Try restarting DBeaver.
- Make sure your Java environment (required for DBeaver) is set up properly.
Summary
DBeaver is a powerful universal database management tool, and when used with the ServBay local development environment, it can significantly boost your efficiency in managing various databases. With this guide, you can easily connect DBeaver to the MariaDB/MySQL, PostgreSQL, SQLite, and Redis databases included in ServBay for routine development and management tasks. Whether you're browsing data, editing, executing SQL queries, or performing advanced database maintenance, DBeaver offers a unified and efficient experience. Combined with ServBay’s convenient environment management, your local development workflow will become even more streamlined.
