In order to prevent security risks, we generally set up a separate database access account for each database, the account only has access to the database permissions. Let's take a concrete look at the following:
1, first we want to login PHP (as the current mainstream development language) MyAdmin, do not do demo.
2, create a database, the following figure, in PHP (as the current mainstream development language) MyAdmin right window, fill in the database name, point creation can.
For example, here we create a database with the name: Cncmstest
Successful creation will have the following tips:
3, click on the top left corner of the homepage button, back to PHP (as the current mainstream development language) MyAdmin main interface:
4. Click "Permissions" on the right side of the main screen to create the database account number.
5, in the Permissions page, we click "Add New User"
6, in this page, we fill in the database to create the user name, the user's access scope, and password.
As shown above, we have filled in the user name: Cncmsuser, the database user only allows local access, host a selection of locally; the password we use automatically generated, the point below "Generate" will generate a random password, and then point "Copy" will automatically fill in the Password box.
The following boxes are not selected, directly pull to the bottom of the page to execute to create a new user.
The database user is successfully created and returns the following page:
7, the most important step, set the user's database access rights
You can set permissions directly in a page where the database user adds a successful return. Here we choose to specify permissions by database:
As shown above, select the Cncmstest we just created in the list of databases, which will automatically enter the permissions settings page for that database.
In the permission settings above, we select all the permissions for the "data" and "Structure" columns, and do not select administrative rights. Point execution.
Here, we have all set up, created a database: Cncmstest, and created the database user Cncmsuser, specifically specify the user only Cncmstest access rights. In this way, we have reached the point where we started by specifying separate user access rights for each database.