14-Supplemental content: MySQL create user and authorization

Source: Internet
Author: User

Rights Management

We know that our top authority manager is the root user, and it has the highest permissions. Includes select, Update, delete, update, Grant, and so on. So in general, after the company, the DBA engineer creates a user and password that allows you to connect to the database and set permissions (or all permissions) for an operationto the current user. Then we need to take a brief look at this:

    • How to create a user and password
    • Authorizing the current user
    • Remove permissions from the current user

If you want to create a new user, the following actions are required:


1. Go to MySQL Database

mysql> use mysqldatabase changed

2. New User deletion

1. Create User:#Specify MJJ User login for ip:192.118.1.1Create user'MJJ'@'192.118.1.1'Identified by'123';#specify ip:192.118.1. MJJ user Login at the beginningCreate user'MJJ'@'192.118.1.%'Identified by'123';#Specify MJJ User login for any IPCreate use'MJJ'@'%'Identified by'123';2. Delete User drop users'User name'@'IP Address';3. Modify user Rename users'User name'@'IP Address'To'New user name'@'IP Address';4. Modify password Set password from 'User name'@'IP Address'=password ('New Password');

3. Management of Current user authorization

#View PermissionsShow grants for 'User'@'IP Address'#AuthorizedGrant SELECT, Insert,update on Db1.t1 to"MJJ"@'%';#indicates the permission, except for Grant, which is the root of the command. Grant all privileges the DB1.T1 to"MJJ"@'%';#Cancel PermissionsRevoke all privileges fromDb1.t1 to'MJJ'@'%';

PS: In a company, it is generally the DBA engineer to do the authorization work. Give you a username and password, you can connect on it.

14-Supplemental content: MySQL create user and authorization

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.