MySQL User management

Source: Internet
Author: User

User Management

1. Query users

Use user;

Select Host,user from user;

2. Create user

Create user hkx001 identified by ' hkx001 ';

Create user [email protected] identified by ' hkx001 ';

Note: [User]@[ip] indicates that the user client must have an IP address of [IP] to connect to the server. [IP] supports fuzzy matching%_.

3. Modify User Password

Set password for hkx001= ' hkx002 ';

4. Renaming users

Rename user hkx001 to hkx002;

5. Delete users

Drop user hkx001;

Rights Management

1. Query permission

Show grants for hkx001;

2. Giving permission

Grant SELECT on world.* to hkx001;

3. Reclaim Permissions

Revoke select on world.* from hkx001;

4. Refresh Permissions

Flush privileges;

Note: Execute this command after modifying the user's permissions.

5. Permission table

Permissions

Description

All

 

Alter

 

Alter routine

Use ALTER procedure and drop procedure

Create

 

Create routine

Using the CREATE PROCEDURE

Create temporary tables

Using the Create temporary table

Create user

 

CREATE view

 

Delete

 

Drop

 

Execute

Using call and stored procedures

File

Using SELECT INTO outfile and load data infile

Grant option

You can use GRANT and revoke

Index

You can use the CREATE INDEX and drop index

Insert

 

Lock tables

Lock table

Process

Use Show full processlist

Reload

Using flush

Replication Client

Server location Access

Replocation slave

Used by replication slaves

Select

 

Show databases

 

Show view

 

Shutdown

Use mysqladmin shutdown to turn off MySQL

Super

 

Update

 

Usage

No access rights

MySQL User management

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.