PhpMyadmin creates a database and an independent database account. Generally, there is more than one site on a server, and more than one MySQL database (the best combination with PHP. To prevent security risks, we generally have more than one site for each database on one server, and more than one MySQL database (the best combination with PHP. To prevent security risks, we generally set an independent database access account for each Database. This account has only the permission to access the database.
Here is a detailed demonstration:
1. first, log on to phpMyAdmin.
2. create a database. for example, in the right-side window of phpMyAdmin, enter the database name and click create.
For example, here we create a database named cncmstest
If the creation is successful, the following message is displayed:
3. click the home button in the upper left corner to return to the main interface of "MyAdmin" in php (as the mainstream development language:
4. click "permission" on the right of the main interface to create a database account.
5. on the permission page, click "add new user"
6. on this page, enter the username, access range, and password of the database to be created.
For example, if the user name is cncmsuser, the database user only allows access from the local computer, and the host is selected as the local computer, the password is automatically generated, click "Generate" below to Generate a random password, and then click "Copy" to automatically fill in the password box.
If none of the following boxes is selected, you can directly pull them to the bottom of the page to create a new user.
If the database user is created successfully, the following page is returned:
7. the most important step is to set the user's database access permissions.
You can directly set permissions on the page returned when the database user is successfully added. Here we choose to specify permissions by database:
Figure 8
For example, if you select the cncmstest created in the database list, the permission settings page of the database is automatically displayed.
Figure 9
In the permission settings, we select all the permissions in the "data" and "structure" columns, and do not select any management permissions. Click to execute.
By now, we have all set up, created a database: cncmstest, and created the database user cncmsuser, specifically specifying that the user only has access to cncmstest. In this way, we can achieve our goal at the beginning: to specify independent user access permissions for each database.
Databases (the best combination with PHP. In order to prevent security risks, we usually set up for every database...