Create user and user rights

Source: Internet
Author: User
Tags md5 encryption


The Structural Library table structure table is in this library!

Permissions plugin Some things are in the MySQL library.

Create users in MySQL inside the user table inside can add modify create delete user!

To set permissions for users to add delete view Create and so on permissions are in this table modify Y is a permission n is not this permission

If you want to create a user or grant permission, you need to log in to create a user or grant permissions!

Create a new user all permissions are N so you have to take the root user in the MySQL library inside the use table to grant this new user permissions!

Create user syntax:

Create user name identified by ' password ';

Give the user permission to view and delete:

Create  Select,drop on to user name;  Give only one table view and delete permissions CreateSelect,drop on library name. * To user name; Give this table all the view and delete permissions

To cancel the query permission:

Select on from user name;   Select on from user name; Recover all permissions for this user library

Grant all permissions for the specified library:

Crant all on library name. * to User; Grant this user all permissions on this library

Grant all permissions to all libraries:

Crant all on * * to users; Permissions for all tables in all libraries

Grant view permission for one column of a table for a library

CreateSelect(sname) on to user name @localhost; Grant Sname only the view permission for this column

Grant the Execute function permission for a user:

Create Execute on function library name. Table name to user @localhost;

To delete a user:

Delete User must take ownership of this user back to remove this user!

Show for user name @localhost; Select on from user name @localhost; You have to take% to regain the authority when you add the @localhost back to add

Change the password when the password (password (' password ')) nested MD5 encryption! He'll give you the encryption MD5 so nobody can see!

Set Password For user =password(' password '); Updateuserset authentication_string=passwordwhereuser = ' user ';

A percent sign means that you can log in with IP, regardless of whether there is a network, whether it is local or not, you can log in. The localhost value can be logged on locally, and you can also specify an IP login.

9

Create user and user rights

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.