# How to Add a User to a Database and Grant Privileges

Follow these steps to add a user to a database and grant privileges in cPanel:

* Log in to your **cPanel account**.
* In the **Databases** section, click on **MySQL Databases**.

<figure><img src="/files/KWiwQLyTPSY2mt089JAH" alt=""><figcaption></figcaption></figure>

* Scroll down to the end of the page and under **Add User to Database**, select a user from the drop-down list and choose a database from the list.
* Click on **Add**.

<figure><img src="/files/CVwLWTcKexQuHNKbEqsF" alt=""><figcaption></figcaption></figure>

* In the **Manage User Privileges** section, mark the box for **ALL PRIVILEGES** and click on **Make Changes**.

<figure><img src="/files/tr0bBKK47n3dCrxIOfrY" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
You have successfully added the user to the database and granted the necessary privileges.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.clouduxe.com/databases/how-to-add-a-user-to-a-database-and-grant-privileges.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
