MySQL user Delete, add and authorize

Source: Internet
Author: User

1) Delete User
Delete from user where user= ' sss ' and host= ' localhost ';
Drop User SSS
Flush Privileges

2) New User

CREATE USER ' user_name ' @ ' host ' identified by ' password ';

USER_NAME: To create the user's name.

Host: Indicates to which machine this newly created user is allowed to log on, if only allow login from local, then fill ' localhost ', if allow remote login, then fill '% '

Password: Newly created user's login database password, if no password can not write.

===
For example CREATE USER ' chunilla ' @ '% ' identified by ' Chunillachunilla '

3) Authorized users

Command: GRANT privileges on databasename.tablename to ' username ' @ ' host '

Privileges: Indicates what power to grant, such as SELECT, Insert, delete,update, etc., if you want to grant full power, fill all

Databasename.tablename: Indicates which table in which library the user's permissions can be used, and if the user's permissions are applied to all tables in all databases, fill in .* is a wildcard, which means all.

' username ' @ ' host ': Indicates which user is authorized.

===
For example, grant Select on circle.* to ' chunilla ' @ '% '

MySQL user Delete, add and authorize

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.