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:
- Log in to your control panel;
- In the "DATABASES" tab, click on the "MySQL® Databases" icon:
- Once in your DB management interface, scroll down to the "Add a user to the database" section:
- In the "User " field, select the user you want to associate with a database (for example "something_diego");
- In the "Database " field, select the database to which you want to link this user (for example "something_my-online-shop");
- Click on the "Add " button to link this user to your database;
- 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:
- You can then validate by clicking on the "Make changes " button;
- 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 " button at the bottom;
- 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: