MySQL database account authorization related management Analysis (1) (2) _ PHP Tutorial

Source: Internet
Author: User
Tags ip number net domain
MySQL database account authorization management Analysis (1) (2 ). 1.1 who can connect and connect from there? You can allow a user to connect from a specific host or a series of hosts. There is an extreme. if you know that demotion is connected from a host, you can assign permissions 1.1 who can connect and connect from there?

You can allow a user to connect from a specific host or a series of hosts. There is one extreme: If you know that a demotion is connected from a host, you can limit the permissions to a single host:

Grant all on samp_db. * TO boris @ localhost identified by "ruby" grant all on samp_db. * TO fred@res.mars.com identified by "quartz"

(Samp_db. * indicates "all tables in the samp_db database.) another extreme is that you may have a user max that is frequently traveling and needs to be connected from hosts around the world. In this case, you can allow him to connect from anywhere:

Grant all on samp_db. * TO max @ % identified by "diamond"

The "%" character acts as a wildcard and matches the LIKE pattern. In the preceding statement, it means "any host ". So max and max @ % are equivalent. This is the easiest way to build a user, but it is also the least secure.

You can allow a user to access from a restricted host set. For example, to allow mary to be connected from any host in the snake.net domain, use the following identifier:

Grant all on samp_db. * TO mary @ .snke.net identified by "quartz ";

If you like, the host part of the user identifier can be specified by an IP address instead of a host name. You can specify an IP address or an address that contains a pattern character. In addition, from MySQL 3.23, you can also specify an IP number with a network mask indicating the number of digits used for the network number:


(T115)

Http://www.bkjia.com/PHPjc/630982.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/630982.htmlTechArticle1.1 who can connect from there? You can allow a user to connect from a specific host or a series of hosts. There is an extreme. if you know that demotion is connected from a host, you can set the right...

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.