# 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="https://3645136414-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIcJwwORgqOz8NHr15WEz%2Fuploads%2F6T5GZKN49GNRE9SIryf2%2Fimage.png?alt=media&#x26;token=f768f70a-975b-44fd-8bfc-5e011965975d" 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="https://3645136414-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIcJwwORgqOz8NHr15WEz%2Fuploads%2F2QcfhJOAqNvbOBuwyaCJ%2Fimage.png?alt=media&#x26;token=8d34d022-3cd4-4108-965f-4ce662ac1b02" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://3645136414-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIcJwwORgqOz8NHr15WEz%2Fuploads%2FDIxkvyNwtP3IgMlk4pMX%2Fimage.png?alt=media&#x26;token=74a713b7-f427-415f-adb3-3682b392a02f" alt=""><figcaption></figcaption></figure>

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