> For the complete documentation index, see [llms.txt](https://docs.glesys.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.glesys.com/products/database/how-tos/manage-databases-and-users.md).

# Manage databases and users

You can add more than one database in each database instance. You can also create users and assign each user either read or read/write access to the databases in a database instance.

***

## Managing databases and users using the control panel

To view and manage the instance's databases and users, click the **Databases and users** tab.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2Fff3lCthVAhqwFv33Toyf%2Fmanage-database-db-users.png?alt=media&amp;token=851fc3df-3da6-4f7a-b6f5-288e2377d5da" alt=""><figcaption></figcaption></figure>

The default database is *defaultdb*, and the default user is *dbadmin*. These can't be removed. The password for *dbadmin* can, however, be reset.

The user *dbadmin* will always have read & write access to all databases.

To reset the *dbadmin* password, click the three dots next to the user, then click **Reset password**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FVhtzi7RNc9SjXcOB4r6p%2Fmanage-database-reset-dbadmin.png?alt=media&amp;token=539c174e-051f-401c-a153-3956100e09b4" alt=""><figcaption></figcaption></figure>

A dialog box will open, telling you that a new password will be generated for *dbadmin*. To confirm, click **Reset password**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FN7aL34PIOKg8ZV3jqoLI%2Fmanage-database-reset-dbadmin-confirm.png?alt=media&amp;token=6d07efa3-48e4-43fc-babc-1c08770fa804" alt=""><figcaption></figcaption></figure>

Please note that any changes you make, such as resetting a password, assigning permissions, or creating users, will take a while before they are applied to the database backend. At the top of the page, you'll see the status as ***Updating...*** while the changes are being applied.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FvafOUPr3D51LRFXB7zlb%2Fmanage-database-updating.png?alt=media&amp;token=49f04943-78df-476b-954b-9b826b6718cc" alt=""><figcaption></figcaption></figure>

### Creating a new database

To create a new database, click **Create database**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FoRE6EAk5SC37bAaFsi9Y%2Fmanage-database-create-db.png?alt=media&amp;token=26fd1392-380d-49ed-9d39-0451c1274fd1" alt=""><figcaption></figcaption></figure>

Give the new database a name, and click **Create database**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FQABlfHw7Vj1aM3ZPN5js%2Fmanage-database-create-db-name.png?alt=media&amp;token=08bf80c7-f888-47af-bd2c-5fd602444ea5" alt=""><figcaption></figcaption></figure>

### Creating a new user

To create a new user, click **Create user**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FmgjNN8DkSDGFUK5qE1Ia%2Fmanage-database-create-user.png?alt=media&amp;token=4f855e7f-c872-40dd-9a3d-3013878591bf" alt=""><figcaption></figcaption></figure>

Give the new user a name, and click **Create user**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2F3EqpH0qVGMmmtTzkvVrp%2Fmanage-database-create-user-name.png?alt=media&amp;token=22ddb66f-69e6-4b94-93ee-7debdbe3c1ce" alt=""><figcaption></figcaption></figure>

A dialog box with the user's password will open. Copy the password and save it in a secure place. It will *not* be shown again. Once you have copied the password, click **Got it**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FmJq27ashatv9QJEhxQfF%2Fmanage-database-create-user-password.png?alt=media&amp;token=dbabc6dc-2647-4f91-b008-27ed6a327628" alt=""><figcaption></figcaption></figure>

### Assigning permissions

To assign a user permission to a database, click the three dots next to the user and click **Edit permissions**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FstFQLxm9ZeRzzffo8l2L%2Fmanage-database-manage-permissions.png?alt=media&amp;token=ed423545-6ac1-4a1f-9ea9-6b589331a00e" alt=""><figcaption></figcaption></figure>

Next, select which permissions the user shall be given for each database. In this example, the user is given **read & write** permissions for *my\_own\_db*, and only **read** permissions for *defaultdb*. Click **Save** to save the changes.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2F5iEhPgenTXDbX0scVcDH%2Fmanage-database-manage-permissions-save.png?alt=media&amp;token=689cc784-d19c-4e4f-9a98-30b7a712c27e" alt=""><figcaption></figcaption></figure>

### Deleting a database

To delete a database from the instance, click the three dots next to the database and select **Delete**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2Fnsp9xQyim4SQRFhwKxt8%2Fmanage-database-delete-db.png?alt=media&amp;token=fc786844-c1b3-49a2-8d72-7f37cd6c8bd4" alt=""><figcaption></figcaption></figure>

To confirm the deletion, type the database name in the field and click **Delete**. Note that this will permanently delete the database and all data stored in it.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FeOjWm6gySp1ORX6u9STT%2Fmanage-database-delete-db-confirm.png?alt=media&amp;token=996df510-3899-455d-86a8-7ca471263707" alt=""><figcaption></figcaption></figure>

### Deleting a user

To delete a user, click the three dots next to the user and select **Delete**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FwtOPjeMH6Dh6Uv1MzbMt%2Fmanage-database-delete-user.png?alt=media&amp;token=22b5c3f3-602d-428f-b117-ad419fc5c5fb" alt=""><figcaption></figcaption></figure>

To confirm the deletion, type the username in the field and click **Delete**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2Fk69L3K3VcjgzzkXL87wT%2Fmanage-database-delete-user-confirm.png?alt=media&amp;token=0d572c3a-6ea9-4565-a035-f50005060169" alt=""><figcaption></figcaption></figure>

## Managing databases and users using the API

Use the following API endpoints to manage databases and users:

* [database/createdatabase](https://github.com/GleSYS/API-docs/wiki/API-Documentation#databasecreatedatabase) to create a new database
* [database/deletedatabase](https://github.com/GleSYS/API-docs/wiki/API-Documentation#databasedeletedatabase) to delete a database
* [database/createuser](https://github.com/GleSYS/API-docs/wiki/API-Documentation#databasecreateuser) to create a new user
* [database/deleteuser](https://github.com/GleSYS/API-docs/wiki/API-Documentation#databasedeleteuser) to delete a user
* [database/resetuserpassword](https://github.com/GleSYS/API-docs/wiki/API-Documentation#databaseresetuserpassword) to reset a user's password
* [database/setuserpermissions](https://github.com/GleSYS/API-docs/wiki/API-Documentation#databasesetuserpermissions) to assign permissions to a user
* [database/details](https://github.com/GleSYS/API-docs/wiki/API-Documentation#databasedetails) to list databases and users in an instance
