Mysql grants note

Source: Internet
Author: User

When installing mycheckpoint and assigning permissions to this monitored user, this secret is discovered: Copy codeThe Code is as follows: mysql>
Mysql> grant all privileges on mycheckpoint. * TO 'mycheckpoint _ user' @ 'localhost' identified by '123 ';
ERROR 1470 (HY000): String 'mycheckpoint _ user' is too long for user name (shocould be no longer than 16)
Mysql>

The grant command is a powerful command for User Creation, permission control, or other parameter control of the mysql database. It has several pages on the official website, I am afraid it is not a day and a half early to use it. I suggest you understand it based on your experience!
A Brief Introduction to the grant command is as follows:
The GRANT statement enables system administrators to grant privileges to MySQL user accounts. GRANT also serves to specify other account characteristics such as use of secure connections and limits on access to server resources. to use GRANT, you must have the grant option privilege, and you must have the privileges that you are granting.
The grant command allows the system administrator to grant various permissions (grant privileges) to the mysql user account ), grant can also be used to set other features of the account, such as security connection and service data access restrictions. To use the grant command, you must have the grant option permission, you must have the permission you want to grant!
Use the show grant command show grants [FOR user]
The command is interpreted as: This statement lists the GRANT statement or statements that must be issued to duplicate the privileges that are granted to a MySQL user account.
To grant permissions to the current user, use one of the following three commands:

Show grants; show grants for CURRENT_USER (); before using the grant command, you need to understand the following information: grant type, that is, what permissions (privilege type) are granted to allow queries? Insert row? Create? Or others. The grant object type (priv_type) has three types: TABLE, FUNCTION, PROCEDURE, and the default type is DATABASE. Grant object (priv_level): does it apply to all databases? Whether to act on a database, all tables in the database, a single table, or even some columns in the table! In this way, we can imagine that a user is a leader in urban management: What permissions does the user have (privilege type) to drive away ghosts? What about zombie theft? What about priv_type? Fruit products? Is it baked or sold? What is the scope of his management: the whole zone? A street? Finally, different permissions can or cannot apply to different object types and ranges. The following sections may be used as a reference:
Dev.mysql.com/doc/refman/5.1/en/privileges-provided.html

The following lists the number of permissions. For details, see dev.mysql.com/doc/refman/5.1/en/grant.html.

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.