MySQL database user creation, permission assignment, deletion, etc.

Source: Internet
Author: User

1. Create a user

CREATE user username @ ' IP address ' identified by ' password ';
CREATE user username @ '% ' identified by ' password ';
ps:% indicates that all ID addresses can connect to the database, and the IP address indicates that only this IP address can connect to the database
**CREATE USER [email protected]‘%‘ identified by ‘123456‘;**

2. User authorization

2.1 Rights Assignment
GRANT permission 1, permission 2 .... on database name. To user name @IP address or%;
All databases are used
. * All permissions are privileges with all or all
PS: Use flush privileges to refresh after assigning permissions
GRANT select,insert,update,delete on blog. TO [email protected]‘%‘;
Flush Privileges

2.2. View Permissions

    • SHOW GRANTS for user name @ip address
      *' SHOW GRANTS for [email protected] '%; ' * *

2.3. Revoke Permissions
REVOKE permissions 1, Permissions 2 ... on database name. * From user name @IP address or%;
*' REVOKE select,update on blog. From [email protected] '%; ' *
Flush Privileges

2.4. Create and authorize a step &&&&&&&&&&&&& use this ...?
GRANT permissions 1, Permissions 2 ... on database name. * To User name @ip address identified by ' password ';
*GRANT all on blog. to [email protected] '% ' identified by ' 123456 '; * *
Flush privileges Refresh a bit

MySQL database user creation, permission assignment, deletion, etc.

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.