How to Manage ServBay Databases with TablePlus
ServBay is a local web development environment for macOS and Windows, integrating various programming languages, web servers, and database systems to provide developers with a one-stop development platform. To efficiently manage the databases bundled with ServBay—such as MySQL/MariaDB, PostgreSQL, SQLite, Redis, and MongoDB—a robust third-party database management tool is highly recommended. TablePlus is a modern, intuitive database client that supports multiple database types, making it an excellent companion for ServBay.
This guide provides detailed steps on using TablePlus to connect to and manage the different databases provided by ServBay on macOS.
What is TablePlus?
TablePlus is a powerful and user-friendly GUI tool for database management. It supports a wide range of databases, including but not limited to:
- Relational databases: MySQL, MariaDB, PostgreSQL, SQLite, SQL Server
- NoSQL databases: Redis, MongoDB
- Others: Cassandra, Oracle, etc.
TablePlus offers a suite of features designed to simplify database development, administration, and maintenance:
- Intuitive Interface: Clean and easy-to-navigate UI.
- Fast Performance: Optimized for speed, with smooth handling of large datasets.
- Powerful Query Editor: Syntax highlighting, autocomplete, and support for multiple query tabs.
- Data Editing and Viewing: Browse, insert, update, and delete data with ease.
- Structure Management: Visual management for tables, indexes, views, and more.
- Secure Connections: SSL/TLS encrypted connections supported.
If you’re developing locally with ServBay, TablePlus can greatly improve the efficiency of your database operations.
Connecting ServBay Databases to TablePlus
ServBay launches and manages multiple database services locally by default. You can view the status of installed and running databases from the Packages tab in the ServBay app. Before connecting these databases to TablePlus, make sure to obtain the correct connection parameters, which are available under the Databases tab in ServBay.
Here’s how to connect each type of ServBay database to TablePlus.
Connecting to MariaDB or MySQL
ServBay comes with MariaDB installed and running by default (fully compatible with MySQL).
- Download and Install TablePlus: If you haven’t already, download the TablePlus client for macOS from the official website.
- Launch TablePlus and Create a New Connection:
- Open TablePlus.
- Click the "+" icon in the top left or navigate via
File
->New
->Connection...
. - In the popup window, choose
MariaDB
orMySQL
as the database type.
- Configure Connection Details:
- Name: Assign an identifiable name, e.g.,
ServBay MariaDB
. - Host:
127.0.0.1
(local connection) - Port:
3306
(default for MariaDB/MySQL) - User: Find the root username for MariaDB/MySQL under the Databases tab in ServBay (usually
root
). - Password: Locate the root password for MariaDB/MySQL in ServBay.
- Database: Leave blank to select a database after connecting or enter a specific database name.
- Alternative: You can also connect via Socket for slightly faster, more direct access.
- Select Use socket file.
- Socket Path:
/Applications/ServBay/tmp/mysql.sock
(default for ServBay MariaDB/MySQL) - When using socket connection,
Host
andPort
are ignored.
- Name: Assign an identifiable name, e.g.,
- Test and Save Connection:
- Click
Test
at the bottom right to verify the credentials. A successful test confirms your configuration. - Click
Connect
to establish the connection, orSave
to store the connection settings for future use.
- Click
Connecting to PostgreSQL
ServBay also supports PostgreSQL.
- Create a New Connection in TablePlus:
- Open TablePlus.
- Click the "+" icon or navigate via
File
->New
->Connection...
. - Select
PostgreSQL
as the database type.
- Configure Connection Details:
- Name: For example,
ServBay PostgreSQL
. - Host:
127.0.0.1
- Port:
5432
(default for PostgreSQL) - User: Find the default PostgreSQL username in ServBay (usually
servbay
). - Password: Find the default PostgreSQL password in ServBay.
- Database: Typically you’ll need to specify an initial database—use
postgres
or any other database you’ve created in ServBay. - Alternative: You can also opt for a Socket connection.
- Enable Use socket file.
- Socket Path:
/Applications/ServBay/tmp/.s.PGSQL.5432
(default for ServBay PostgreSQL) - With Socket,
Host
andPort
are ignored.
- Name: For example,
- Test and Save Connection:
- Click
Test
to validate the connection. - Click
Connect
orSave
.
- Click
Connecting to SQLite 3
SQLite is a serverless, self-contained database engine where data is stored in a single file. ServBay does not “run” an SQLite server process, but your application can access SQLite files via PHP PDO SQLite, Python’s sqlite3
, and more. TablePlus lets you connect directly to a database file.
- Create a New Connection in TablePlus:
- Open TablePlus.
- Click the "+" icon or navigate via
File
->New
->Connection...
. - Select
SQLite
as the database type.
- Configure Connection Details:
- Name: For example,
ServBay SQLite Project
. - Database File: Click the folder icon, browse, and select your
.sqlite
,.db
, or.sqlite3
database file. For convenience, store project databases in your project directory or ServBay’s recommended location:/Applications/ServBay/db/sqlite
.
- Name: For example,
- Test and Save Connection:
- Click
Test
(if the file exists and is readable). - Click
Connect
orSave
.
- Click
Connecting to Redis
Redis is a high-performance key-value database. ServBay can install and run Redis.
- Create a New Connection in TablePlus:
- Open TablePlus.
- Click the "+" icon or go to
File
->New
->Connection...
. - Choose
Redis
as the database type.
- Configure Connection Details:
- Name: For example,
ServBay Redis
. - Host:
127.0.0.1
- Port:
6379
(default Redis port) - Password: If you set a password for Redis in ServBay, enter it here. By default, ServBay Redis doesn’t use a password, so you can leave this blank.
- Name: For example,
- Test and Save Connection:
- Click
Test
to validate. - Click
Connect
orSave
.
- Click
Connecting to MongoDB
ServBay supports installing and running MongoDB.
- Create a New Connection in TablePlus:
- Open TablePlus.
- Click the "+" icon or navigate via
File
->New
->Connection...
. - Select
MongoDB
as the type.
- Configure Connection Details:
- Name: For example,
ServBay MongoDB
. - Host:
127.0.0.1
- Port:
27017
(default MongoDB port) - User: If you enabled authentication for MongoDB, enter your username. By default, ServBay’s MongoDB might not have authentication enabled, so you can leave user and password blank.
- Password: Enter your password if authentication is enabled.
- Authentication Database: If using authentication, you may need to specify the auth database, e.g.,
admin
. - Database: Leave blank to select later, or enter the name of the database you wish to connect to.
- Name: For example,
- Test and Save Connection:
- Click
Test
to validate the connection. - Click
Connect
orSave
.
- Click
Managing Relational Databases in TablePlus (MariaDB/MySQL, PostgreSQL, SQLite)
Once connected, TablePlus offers a consistent interface and workflow for managing MariaDB/MySQL, PostgreSQL, and SQLite.
1. Create a Database
- After connecting (for SQLite, after opening the file), you’ll see a sidebar on the left.
- For MariaDB/MySQL and PostgreSQL, click the Databases tab on the left.
- Click the "+" (New) button in the top left or right-click an empty area and select
New Database...
. - Enter a database name, choose charset and collation if needed.
- Click
Save
.
2. Create a Table
- Select the database where you want to create the table in the sidebar.
- Click the Tables tab.
- Click the "+" (New) button in the top left or right-click and choose
New Table...
. - Enter a table name.
- Define columns below:
- Click "+" to add a column.
- Enter the column name.
- Choose a type.
- Set length/values if required.
- Tick
PK
for primary key,NN
for not null,UQ
for unique index,AI
for auto-increment, etc. - Set a default value if desired.
- Add comments as needed.
- When done, click
Save
in the top left (or useCmd + S
) to save the table structure.
3. Add Data
- Select the database containing your table in the sidebar.
- Click Tables, then choose your target table.
- In the data view, click + Row at the bottom.
- A new empty row will appear—double-click cells to enter data.
- After entering data, click
Save
(or useCmd + S
) to commit changes.
4. Query Data
- Select the database and table in the sidebar.
- Browse data directly in the table view.
- Use the Filter box at the top for quick searches.
- For advanced queries, use the SQL query editor:
- Click
SQL Query
on the toolbar or useCmd + N
. - In a new query tab, enter your SQL (e.g.,
SELECT * FROM your_table WHERE condition;
). - Click
Run Current
(lightning icon) or useCmd + Enter
to execute and view results below.
- Click
5. Update Data
- In the data view, double-click a cell you want to change.
- Enter new data.
- Click
Save
(or useCmd + S
) to commit updates.
6. Delete Data
- Select one or more rows you wish to delete in the data view.
- Right-click the selection, and choose
Delete Row(s)
. - Confirm deletion in the popup window.
- Click
Save
(or useCmd + S
) to finalize.
7. Delete a Table
- In the sidebar, select the database containing your table.
- Click Tables.
- Select one or more tables to remove.
- Right-click and choose
Delete Table(s)
. - Confirm by entering the table name in the dialog, then click
Delete
.
8. Delete a Database
- For MariaDB/MySQL or PostgreSQL, go to Databases in the sidebar.
- Select the database to delete.
- Right-click and choose
Delete Database
. - Confirm by entering the database name, then click
Delete
. - For SQLite: Delete the database by removing its
.sqlite
file in the filesystem.
Managing NoSQL Databases in TablePlus (Redis, MongoDB)
TablePlus provides specialized interfaces for managing Redis and MongoDB, which differ from relational database management.
Managing Redis Data
Once connected to Redis:
- The sidebar displays the Redis databases (DB0, DB1, ...), with DB0 as default.
- Select a database; all keys will appear on the right.
- Browse Keys: View keys in the list, use the filter box at the top for searching. Click on a key to see its type and value. TablePlus formats data for various types, including strings, hashes, lists, sets, and sorted sets.
- Add a Key: Click + Row at the bottom, choose the type, enter the key name and value, and click
Save
. - Edit a Key: Double-click the key name or value to modify, then click
Save
. - Delete Keys: Select one or more keys, right-click and choose
Delete Row(s)
, then confirm.
Managing MongoDB Data
Once connected to MongoDB:
- The sidebar lists all MongoDB databases.
- Select a database to view its collections on the right.
- View Collection Data: Double-click a collection to view its documents, usually in JSON format.
- Add Documents: In the collection view, click + Row at the bottom for a new blank document, and double-click fields to edit. Click
Save
. - Edit Documents: Double-click fields or values, or edit raw JSON/BSON. Click
Save
. - Delete Documents: Select documents, right-click, and choose
Delete Row(s)
, then confirm. - Create a Collection: In the sidebar, select a database, click Collections, then click "+" at the top left or right-click and choose
New Collection...
, enter a name, and clickSave
. - Delete a Collection: In the sidebar, select a database and click Collections, select the collection, right-click and choose
Delete Collection(s)
, then confirm. - Delete a Database: Select the database to delete, right-click and choose
Delete Database
, then confirm.
Troubleshooting and FAQs
- ServBay Status: Ensure ServBay is running, and that the database service you wish to connect to (MariaDB, PostgreSQL, Redis, MongoDB) appears as "Running" under the Packages tab.
- Firewall: Make sure the macOS firewall or third-party security software isn’t blocking TablePlus from communicating with local database ports (3306, 5432, 6379, 27017).
- Getting Credentials: Database usernames and passwords can be found under the Databases tab in the ServBay app—keep these safe!
- Changing Default Passwords: For security, change the default root or standard user passwords in ServBay. You can reset them via ServBay’s Databases tab—be sure to update your TablePlus connection as needed.
- Socket vs. Port Connections: Socket connections use filesystem paths for inter-process communication—typically faster and unaffected by network settings, but limited to the same machine. Port (TCP/IP) connections use
127.0.0.1
for local access and are also suitable for connecting to remote databases in a network. Both methods usually work in the ServBay local environment. - Can I Use Other Tools? Absolutely! Besides TablePlus, you can use popular alternatives like DBeaver, DataGrip, Sequel Ace (MySQL/MariaDB), pgAdmin (PostgreSQL), MongoDB Compass (MongoDB), etc. Just grab the correct connection info from ServBay’s Databases tab.
Conclusion
With this guide, you now know how to use TablePlus on macOS to connect to and efficiently manage all types of databases in the ServBay local development environment. TablePlus’s powerful features and user-friendly interface—combined with ServBay’s all-in-one local setup—will dramatically boost your development productivity. Always remember to retrieve your database credentials from ServBay, as they are the key to successful connections. Happy coding!