Two ways to license MySQL database

Source: Internet
Author: User

Two ways to license MySQL database


Method One: Create a user by using the grant command and authorize

  1. The simple syntax for the grant command is as follows:

    Grant all privileges the dbname.* to [e-mail protected] identified by ' passwd ';

  2. The list is described below:

    650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/9E/00/wKioL1mJxPvStj7RAAD3znk_EEc526.png "title=" 11. PNG "width=" height= "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:60px; "alt=" Wkiol1mjxpvstj7raad3znk_eec526.png "/>

    Description: The above command is to authorize all permissions on the localhost host to manage dbname database through user username, password is passwd. Among them, USERNAME,DBNAME,PASSWD can be modified according to the business situation.

  3. Example: Create a ZD user, have all permissions on the test library, allow login from localhost host to manage database, password is 123456.

    First, look at the current database user situation:

    Mysql> select User,host from Mysql.user;

    650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/9E/00/wKioL1mJyJKBizxPAAAefqtK-0M921.png "title=" 11. PNG "width=" "height=" 175 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:175px; "alt=" Wkiol1mjyjkbizxpaaaefqtk-0m921.png "/> Then, execute the following authorization command:

    Mysql> Grant all on test.* to [e-mail protected] identified by ' 123456 ';

    Finally, look at the current database user situation:

    Mysql> select User,host from Mysql.user;

    650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9E/00/wKioL1mJyXXhpSuOAAAhwTQ7x2k667.png "title=" 11. PNG "width=" "height=" 192 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:192px; "alt=" Wkiol1mjyxxhpsuoaaahwtq7x2k667.png "/>

    To view authorized user specific permissions:

    Mysql> Show grants for [email protected]; (or mysql> show grants for [email protected]\g)

    650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/9E/01/wKiom1mJyx2SlGBNAAAfkg_--YE777.png "title=" 11. PNG "width=" "height=" 144 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:144px; "alt=" Wkiom1mjyx2slgbnaaafkg_--ye777.png "/>

    Note: You can see that the default permissions are usage, that is, connection permissions, followed by the addition of the all permission!

Method Two: Create and grant mate method

  1. First create user username and password passwd, authorize host localhost.

    Syntax: create user [email protected] identified by ' passwd ';

    Such as: Create user www and password 123456, authorized host localhost.

    mysql> create user [email protected] identified by ' 123456 ';

  2. It then authorizes all permissions on the localhost host to manage the dbname database through user username, without a password.

    Syntax: Grant all on dbname.* to [email protected];

    Such as: Authorize the localhost host on the WWW Management test database all permissions.

    Mysql> Grant all on test.* to [email protected];

  3. View Current User information:

    Mysql> select User,host from Mysql.user;

    650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/9E/01/wKioL1mJ1RaivgaDAAAj-Gt5HNU039.png "title=" 11. PNG "width=" "height=" 208 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:208px; "alt=" Wkiol1mj1raivgadaaaj-gt5hnu039.png "/>

  4. View www specific permissions:

    Mysql> Show grants for [email protected]; (or mysql> show grants for [email protected]\g)

    650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/9E/01/wKioL1mJ1g6DKUYRAAAX_r_ag98406.png "title=" 11. PNG "width=" "height=" 124 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:124px; "alt=" Wkiol1mj1g6dkuyraaax_r_ag98406.png "/>

This article is from the "Hand of the Paladin Control" blog, please make sure to keep this source http://wutengfei.blog.51cto.com/10942117/1954646

Two ways to license MySQL database

Related Article

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.