How to Use DBeaver to Manage Databases
What is DBeaver
DBeaver is a powerful database management and development tool that supports multiple database systems, including MySQL, MariaDB, PostgreSQL, SQLite, Redis, etc. DBeaver provides a feature-rich and user-friendly interface that makes database management more efficient and convenient. DBeaver has the following notable advantages:
- Multi-database support: DBeaver supports multiple database systems, making it a versatile tool for developers.
- User-friendly: Offers an easy-to-use graphical interface to help users execute various database operations effortlessly.
- High performance: DBeaver emphasizes performance optimization and can quickly handle large-scale data.
- Cross-platform support: DBeaver supports Windows, macOS, and Linux operating systems.
For developers, DBeaver not only increases work efficiency but also simplifies the complexity of database management.
Using DBeaver to Manage the MariaDB (MySQL) Database Built into ServBay
Logging into the Server
- Download and Install DBeaver: Download and install the DBeaver client suitable for your operating system from the DBeaver official website.
- Create a New Connection:
- Open DBeaver and click the "New Database Connection" button in the top left corner.
- Select the database type as "MariaDB" or "MySQL."
- Enter Connection Information:
- Username and Password: Can be obtained from ServBay's 'Settings' -> 'Database'.
- Port:
3306
(Note: Port and Socket only need to choose one) - Socket:
/Applications/ServBay/tmp/mysql.sock
- Other information such as the database name can be left blank and selected later.
- Test and Save the Connection: Click the "Test Connection" button to ensure the connection information is correct, then click the "Next" button to save the connection.
Create a Database
- Enter the Database Management Interface: After a successful login, expand the database connection on the left side.
- Create a New Database:
- Right-click the database connection and select "SQL Editor" -> "New SQL Script."
- Enter the SQL command to create a database, for example:
CREATE DATABASE mydatabase;
- Click the "Execute" button to run the SQL command.
Create a Table
- Select the Database: Expand the newly created database in the list on the left side.
- Create a Table:
- Right-click "Tables" and select "Create New Table."
- Enter table name and field information (e.g., field names, types, lengths, default values, etc.).
- Click the "Save" button to create the table.
Add Data
- Select the Table: Select the table to operate on from the list on the left side.
- Insert Data:
- Right-click the table name and select "Edit Data."
- In the data edit view, click the "Add New Row" button.
- Enter data values.
- Click the "Save" button to save the data.
Query Data
- Select the Table: Select the table to operate on from the list on the left side.
- Browse Data:
- Right-click the table name and select "View Data."
- In the data view, directly view the data in the table.
- SQL query functionality can also be used to filter data.
Update Data
- Select the Table: Select the table to operate on from the list on the left side.
- Edit Data:
- Right-click the table name and select "Edit Data."
- In the data edit view, double-click the row of data to modify.
- Update data values.
- Click the "Save" button to save the modifications.
Delete Data
- Select the Table: Select the table to operate on from the list on the left side.
- Delete Data:
- Right-click the table name and select "Edit Data."
- In the data edit view, select the row of data to delete.
- Click the "Delete Row" button.
- Click the "Save" button to confirm deletion.
Delete a Table
- Select the Database: Select the database containing the table to delete from the list on the left side.
- Delete Table:
- Right-click the table name to delete and select "Delete."
- Confirm the delete operation.
Delete a Database
- Select the Database: Select the database to delete from the list on the left side.
- Delete Database:
- Right-click the database name and select "Delete."
- Confirm the delete operation.
Using DBeaver to Manage the PostgreSQL Database Built into ServBay
Logging into the Server
- Create a New Connection:
- Open DBeaver and click the "New Database Connection" button in the top left corner.
- Select the database type as "PostgreSQL."
- Enter Connection Information:
- Username and Password: Can be obtained from ServBay's 'Settings' -> 'Database'.
- Host/Socket:
127.0.0.1
or/Applications/ServBay/tmp/.s.PGSQL.5432
- Port:
5432
(If the Socket method is chosen, the Port does not need to be entered) - Other information such as the database name can be left blank and selected later.
- Test and Save the Connection: Click the "Test Connection" button to ensure the connection information is correct, then click the "Next" button to save the connection.
Create a Database
- Enter the Database Management Interface: After a successful login, expand the database connection on the left side.
- Create a New Database:
- Right-click the database connection and select "SQL Editor" -> "New SQL Script."
- Enter the SQL command to create a database, for example:
CREATE DATABASE mydatabase;
- Click the "Execute" button to run the SQL command.
Create a Table
- Select the Database: Expand the newly created database in the list on the left side.
- Create a Table:
- Right-click "Tables" and select "Create New Table."
- Enter table name and field information (e.g., field names, types, lengths, default values, etc.).
- Click the "Save" button to create the table.
Add Data
- Select the Table: Select the table to operate on from the list on the left side.
- Insert Data:
- Right-click the table name and select "Edit Data."
- In the data edit view, click the "Add New Row" button.
- Enter data values.
- Click the "Save" button to save the data.
Query Data
- Select the Table: Select the table to operate on from the list on the left side.
- Browse Data:
- Right-click the table name and select "View Data."
- In the data view, directly view the data in the table.
- SQL query functionality can also be used to filter data.
Update Data
- Select the Table: Select the table to operate on from the list on the left side.
- Edit Data:
- Right-click the table name and select "Edit Data."
- In the data edit view, double-click the row of data to modify.
- Update data values.
- Click the "Save" button to save the modifications.
Delete Data
- Select the Table: Select the table to operate on from the list on the left side.
- Delete Data:
- Right-click the table name and select "Edit Data."
- In the data edit view, select the row of data to delete.
- Click the "Delete Row" button.
- Click the "Save" button to confirm deletion.
Delete a Table
- Select the Database: Select the database containing the table to delete from the list on the left side.
- Delete Table:
- Right-click the table name to delete and select "Delete."
- Confirm the delete operation.
Delete a Database
- Select the Database: Select the database to delete from the list on the left side.
- Delete Database:
- Right-click the database name and select "Delete."
- Confirm the delete operation.
Using DBeaver to Manage SQLite 3 Databases
Logging into the Server
- Create a New Connection:
- Open DBeaver and click the "New Database Connection" button in the top left corner.
- Select the database type as "SQLite."
- Enter Connection Information:
- Database File Path: It is recommended to place the DB file under the
/Applications/ServBay/db/sqlite
directory. - Select database file.
- Database File Path: It is recommended to place the DB file under the
- Test and Save the Connection: Click the "Test Connection" button to ensure the connection information is correct, then click the "Next" button to save the connection.
Create a Database
- Create a New Database File: Enter the new database file path and name in the connection information.
- Save: Click the "Save" button to create the database.
Create a Table
- Select the Database: Select the newly created database from the list on the left side.
- Create a Table:
- Right-click the database name and select "Create New Table."
- Enter table name and field information (e.g., field names, types, lengths, default values, etc.).
- Click the "Save" button to create the table.
Add Data
- Select the Table: Select the table to operate on from the list on the left side.
- Insert Data:
- Right-click the table name and select "Edit Data."
- In the data edit view, click the "Add New Row" button.
- Enter data values.
- Click the "Save" button to save the data.
Query Data
- Select the Table: Select the table to operate on from the list on the left side.
- Browse Data:
- Right-click the table name and select "View Data."
- In the data view, directly view the data in the table.
- SQL query functionality can also be used to filter data.
Update Data
- Select the Table: Select the table to operate on from the list on the left side.
- Edit Data:
- Right-click the table name and select "Edit Data."
- In the data edit view, double-click the row of data to modify.
- Update data values.
- Click the "Save" button to save the modifications.
Delete Data
- Select the Table: Select the table to operate on from the list on the left side.
- Delete Data:
- Right-click the table name and select "Edit Data."
- In the data edit view, select the row of data to delete.
- Click the "Delete Row" button.
- Click the "Save" button to confirm deletion.
Delete a Table
- Select the Database: Select the database containing the table to delete from the list on the left side.
- Delete Table:
- Right-click the table name to delete and select "Delete."
- Confirm the delete operation.
Delete a Database
- Select the Database File: Select the database file to delete from the file system.
- Delete File: Manually delete the file or use a file management tool to delete it.
Using DBeaver to Manage the Redis Database Built into ServBay
Logging into the Server
- Create a New Connection:
- Open DBeaver and click the "New Database Connection" button in the top left corner.
- Select the database type as "Redis."
- Enter Connection Information:
- Username and Password: Leave blank.
- Host:
127.0.0.1
- Port:
6379
- Other information such as the database name can be left blank and selected later.
- Test and Save the Connection: Click the "Test Connection" button to ensure the connection information is correct, then click the "Next" button to save the connection.
Manage Data
- Select the Database: Select the Redis instance to operate on from the list on the left side.
- View Keys:
- In the database view, directly view all keys.
- Use the filter function to quickly find specific keys.
- Add Keys:
- Right-click on a blank area and select "New Key."
- Enter key name, type, and value.
- Click the "Save" button to add the key.
- Edit Keys:
- Right-click the key to modify and select "Edit Key."
- Update key value or attributes.
- Click the "Save" button to save the modifications.
- Delete Keys:
- Right-click the key to delete and select "Delete Key."
- Confirm the delete operation.
By following the above steps, you can easily manage various database systems built into ServBay using DBeaver. DBeaver's clean interface and powerful features will greatly enhance your database management efficiency. Whether it's creating databases, tables, inserting, querying, updating, or deleting data, DBeaver provides a convenient operating experience.