Mysql command for creating various permission users

Source: Internet
Author: User

Use the following command to create a mysql account with various permissions ):

1. create a user and have the permissions to create a database, modify fields, delete tables, add, delete, modify, and query tables, and to allow remote and even remote login (equivalent to the root account ):

Grant select, insert, update, delete, create, drop, alter on *. * to reson1 @ "%" identified by "123456 ";
Grant select, insert, update, delete, create, drop, alter on *. * to reson1 @ localhost identified


"123456"; (you must add a "%" and a localhost to support both local access and remote access from any ip address. Reson1 indicates the user name and 123456 indicates the password)

2. Create a user and have the permission to add, delete, modify, and query tables. You can only log on locally:

Grant select, insert, update, delete on *. * to reson2 @ localhost identified by "123456 ";

3. Create a user and have the permission to add, delete, modify, and query tables. You can only log on to 192.168.1.100 and only operate on dat1 databases:

Grant select, insert, update, delete on dat1. * to reson3@192.168.1.100 identified by "123456 ";

Master the above three cases to create mysql accounts with various permissions.
 

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.