MySQL Security language

Source: Internet
Author: User

Experiment 2: Security language

The safety experiment consists of two experimental projects, of which 1 are compulsory and1 are elective. The autonomous access control experiment is a design-type experimental project, and the audit experiment is a verification experiment project, which can be selected.

Experiment 2.1 Autonomous Access control experiment

(1) Purpose of the experiment

Master the definition and maintenance of autonomous access control authority.

(2) experimental content and requirements

Define users, roles, assign permissions to users, roles, reclaim permissions, log on to the database with the appropriate user name to verify that permissions are assigned correctly. Select a scenario and use the autonomic access control mechanism to design the rights assignment. Two scenarios can be used. Scheme one: The system superuser login database, complete All rights assignment work, and then use the corresponding user name to log into the database to verify the correctness of the rights allocation, before verifying the rights allocation, please back up the database, for different users have permissions, respectively, design the corresponding SQL statements are validated.

(3) experimental emphases and difficulties

Lab Focus: Define roles, assign permissions, and reclaim permissions.

Experimental difficulty: The implementation of the second allocation of permissions and recycling.

A) Create user Fengxingwei, password 1993, host login as localhost:

In Workbench view you can see that the user Fengxingwei exists, stating that the creation was successful.

Enter show grants for ' Fengxingwei ' @ ' localhost '; View user Fengxingwei permissions temporarily as follows:

Use the system root user root to give all permissions to the user Fengxingwei all privileges

Continue show grants for ' Fengxingwei ' @ ' localhost '; view can discover user Fengxingwei permissions as follows:

b) Exit root and log in as fengxingwei as user.

c) Start verifying that the assigned permissions are correct. The original 4 databases and permissions under Root are as follows:

under Fengxingwei users can find that they have the same permissions as root and can see the 4 databases created by root .

d) User Fengxingwei login, SELECT permission Check, you can see the select Success.

Insert permissions Check to see Insert success:

The update permission check can be done by seeing the update succeed:

A delete permission check can be performed by seeing the delete succeed:

e) Log in root and reclaim the root to Fengxingwei permissions

You can verify that Fengxingwei has its permissions retracted:

Switch to Fengxingwei login and you can see that the database created by root is not visible.

MySQL Security language

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.