Sometimes you need more than one user account for a database, for example to give an application limited access or to let a developer connect without your main credentials. DirectAdmin lets you create additional MySQL users and assign them to a database. This guide explains how.
Why add another database user #
- Give an application its own dedicated credentials.
- Grant a developer access without sharing your main user.
- Limit permissions so each user has only what it needs.
Creating and assigning a user #
- Log in bij DirectAdmin.
- Ga naar Accountmanager > MySQL-beheer.
- Open the database you want to grant access to.
- Create a new user with a strong password, or select an existing one.
- Assign the user to the database and set the privileges it should have.
- Opslaan.
Rechten selecteren #
Grant only what is needed. A typical application user needs data privileges such as SELECT, INSERT, UPDATE, and DELETE, while administrative privileges should be limited. Keeping permissions minimal is good security practice.
Using the new credentials #
Note the database name, the new username, the password, and the host (usually localhost). Enter these into your application’s configuration so it connects with the new user.
Problemen oplossen #
- Toegang geweigerd: Controleer of de gebruiker aan de database is toegewezen met de juiste rechten.
- De app kan geen verbinding maken: re-check the name, user, password, and host.
Hulp nodig? #
If a database user will not connect, our support team can help over live chat.