Home >Backend Development >PHP Tutorial >phpMyadmin creates Mysql database and independent database account_PHP tutorial
phpMyadmin creates Mysql database and independent database account
First we need to log in to the PHP tutorial (as the current mainstream development language) MyAdmin without demonstration.
2. Create a database tutorial, as shown below. In the right window of MyAdmin in PHP (as the current mainstream development language), fill in the database name and click Create.
For example, we create a database named: cncmstest
If the creation is successful, the following prompt will appear:
3. Click the home button in the upper left corner to return to php (as the current mainstream development language) MyAdmin main interface:
4. Click "Permissions" on the right side of the main interface to create a database account.
5. In the permissions page, we click "Add New User"
6. On this page, we fill in the database user name to be created, the user's access scope, and password.
As shown in the picture above, we filled in the user name: cncmsuser. The database user only allows local access. For the host, select local; we use the automatically generated password. Click "Generate" below to generate a random password, and then Clicking "Copy" will automatically fill in the password box.
Do not select any of the boxes below, just scroll to the bottom of the page and click Execute to create a new user.
If the database user is successfully created, the following page will be returned:
7. The most important step is to set the user’s database access permissions
Permissions can be set directly on the page returned after the database user is successfully added. Here we choose to specify permissions by database:
As shown in the picture above, select the cncmstest we just created in the database list, and you will automatically enter the permission setting page of the database.
In the permission settings in the picture above, we select all the permissions in the "Data" and "Structure" columns, and do not select the management permissions. Just click Execute.
At this point, we have completed all settings, created a database: cncmstest, and created the database user cncmsuser, specifically specifying that the user only has access rights to cncmstest. In this way, we achieve the purpose we talked about at the beginning: specifying independent user access rights for each database.