How to assign a user to a MySQL database? Print

  • 30

To be able to associate a MySQL user to a MySQL database, you must first have created the database and the user, here are the prerequisite topics describing these procedures:


Once you have a MySQL database and a user, all you have to do is associate this user with the database so that he can access it. Here are the steps to follow to do this:

  1. Log in to your control panel;
  2. In the "DATABASES" tab, click on the "MySQL® Databases" icon:
    Associer un utilisateur à une BDD MySQL

  3. Once in your DB management interface, scroll down to the "Add a user to the database" section:
    Associer un utilisateur à une BDD MySQL

  4. In the "User
  5. " field, select the user you want to associate with a database (for example "something_diego");
  6. In the "Database
  7. " field, select the database to which you want to link this user (for example "something_my-online-shop");
  8. Click on the "Add
  9. " button to link this user to your database;
  10. In the user privilege management interface that appears afterwards, unless you have a specific need that you are fully aware of, check the "ALL PRIVILEGES" box:
    Associer un utilisateur à une BDD MySQL

  11. You can then validate by clicking on the "Make changes
  12. " button;
  13. A "pop-up" (contextual panel) will indicate that your changes are taken into account, you can then return to the MySQL interface by clicking on the "Back
  14. " button at the bottom;
  15. In the "Current databases" section you will see that the user is correctly associated with your database because he will appear in the "Privileged users" column of your database:
    Associer un utilisateur à une BDD MySQL

Was this answer helpful?

« Back