MySQL Remote access control

Source: Internet
Author: User
Tags ip number

If you need to have 192.168.2.3 's test user access to all of the local databases, the MySQL command is as follows

MySQL>GRANTallprivilegeson*. *  to ' Test ' @ '192.168. 2.3′identifiedby '123456 '; MySQL>privileges;

Grant Syntax description

Grant  on Library name (* all). Table name (* to ' username to be authorized ' @ '%' (% by "password";

The MySQL identity check is performed using the Mysql.user table (Host, user, and password) with 3 scope columns. The server accepts a connection only if the host and user columns of the user table record match the client hostname and username and provide the correct password.

In the user table, specify the host value method:

The 1:host value can be a hostname or IP number, or ' localhost ' indicates that the local host

2: You can use wildcard characters "%" and "_" in the Host column values

The 3:host value '% ' matches any host name, and the empty host value is equivalent to '% '. They have the same meaning as the pattern-matching operation of the LIKE operator. For example, the '% ' host value matches all host names, while '%.mysql.com ' matches all hosts in the mysql.com domain

MySQL Remote access control

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.