5 min To learn mariadb create a role feature

Source: Internet
Author: User

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M02/88/4B/wKiom1ftzByzp1dJAAA6K0SjNFA391.jpg "title=" icon 2. JPG "alt=" Wkiom1ftzbyzp1djaaa6k0sjnfa391.jpg "/>


Part1: Grant Role?

Creating roles, Oracle has long supported the ability to create roles, and the MySQL5.7 version is still not supported. Currently, the ability to create roles is supported only in the mariadb10.0/10.1 version.


Part2: Why do we need characters

1. In actual work, there are a large number of users whose permissions are the same, such as read-only permissions. It would be a lot of trouble if the DBA went on to authorize each user separately each time after the user was created.

2. The benefit of using role is that DBAs only need to partition the kind of permissions and then grant different permissions to different role, without having to focus on what specific users are.

3. When role permissions change, such as adding members or deleting members, the system administrator does not need to perform any operations on permissions.


Part3: Roles Overview

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/88/47/wKioL1ftx7OBdXAoAAHmiZJNEqY911.jpg "title=" 4.JPG " alt= "Wkiol1ftx7obdxaoaahmizjneqy911.jpg"/>


PART4: How to use the role of MARIADB

1) Create a dbuser role.

2) Grant Select/insert/update/delete permissions to the Dbuser role.

3) give [email protected] '% ' user dbuser role and create password MANAGER as shown:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/88/47/wKioL1ftv53TcPutAAFbPd8Nzdg063.jpg "title=" 1.JPG " alt= "Wkiol1ftv53tcputaafbpd8nzdg063.jpg"/>



4) Set Dbuser as the default role for the Helei user and turn on the Dbuser role as shown in:

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M00/88/4A/wKiom1ftw-Dy9ooGAAEW6iDb3cE953.jpg "title=" 2.JPG " alt= "Wkiom1ftw-dy9oogaaew6idb3ce953.jpg"/>



5) As you can see here, the Create command denied error is thrown when building a table because the Dbuser role does not have the Create permission because only the Helei user Dbuser role is authorized.

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M00/88/4A/wKiom1ftw_XTcEK_AAG0R-U2VCU718.jpg "title=" 3.JPG " alt= "Wkiom1ftw_xtcek_aag0r-u2vcu718.jpg"/>


-- Summary --

Role creation, which greatly reduces the complexity of maintaining user rights, and also expects MySQL to support this feature as early as possible. due to the author's limited level, writing time is also very hasty, the text will inevitably appear some errors or inaccurate places, inappropriate to ask readers to criticize correct.




This article is from the "Age volt" blog, please make sure to keep this source http://suifu.blog.51cto.com/9167728/1858005

5 min To learn mariadb create a role feature

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.