Create User _ mysql in MySQL

Source: Internet
Author: User
Mysql creates user bitsCN.com
Grant all privileges on *. * TO username @ '%' identified by "password"

Assign the access permission to all databases of remote username.

Password is used for accessing username from any table in any database.

1 grant all privileges on test_db. * TO user1@192.168.1.3 identified by "password"
2 grant all privileges on test_db. * TO user2@192.168.1. % identified by "password"
3 grant all privileges on test_db. * TO user3@192.168.1.0/10 identified by "password"

Obviously, the first sentence is that user user1 can only be accessed on 192.168.1.3. The second sentence is that it can be accessed within the 192.168.1 network segment. The third sentence is ip 0-10.

Delete a user:

Delete from user WHERE User = "username" and Host = "localhost ";

Don't forget this sentence.

Flush privileges;





BitsCN.com

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.