In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The following mainly brings you how to obtain mysql user rights in batches. I hope these words can bring you practical use, which is also the main purpose of how I edit mysql user rights to obtain this article in batches. All right, don't talk too much nonsense, let's just read the following.
-- permissions at the CVM level
Select a.GRANTEEEE GROUPPRONCONcat (a.PRIVILEGE_TYPE), concat ("grant", GROUP_CONCAT (a.PRIVILEGE_TYPE), "ON *. * to", a.GRANTEE) from USER_PRIVILEGES a GROUP BY GRANTEE
-- permissions at db level
Select GRANTEE,TABLE_SCHEMA,GROUP_CONCAT (PRIVILEGE_TYPE), concat ("grant", GROUP_CONCAT (PRIVILEGE_TYPE), "ON", TABLE_SCHEMA, ". * to", GRANTEE) from information_schema.SCHEMA_PRIVILEGESGROUP BY GRANTEE,TABLE_SCHEMA
-- Table-level permissions
Select GRANTEE,TABLE_SCHEMA,table_name,GROUP_CONCAT (PRIVILEGE_TYPE), concat ("grant", GROUP_CONCAT (PRIVILEGE_TYPE), "ON", TABLE_SCHEMA, ".", table_name, "to", GRANTEE) from information_schema.TABLE_PRIVILEGESGROUP BY GRANTEE,TABLE_SCHEMA,table_name
-column level permissions
Select GRANTEE,TABLE_SCHEMA,table_name,COLUMN_NAME,GROUP_CONCAT (PRIVILEGE_TYPE) from information_schema.COLUMN_PRIVILEGESGROUP BY GRANTEE,TABLE_SCHEMA,table_name,COLUMN_NAME
-- obtain user permissions and passwords (ciphertext)
Select a.GRANTEEEE GROUPPERCONcat (a.PRIVILEGE_TYPE), concat ("grant", GROUP_CONCAT (a.PRIVILEGE_TYPE), "ON *. * to", a.GRANTEE, "identified by password'", c.authentication_string, "';") privifrom USER_PRIVILEGES a left join mysql.user con a.GRANTEE = concat ("'", c.user, "'", "@", "", c.host, "'") GROUP BY GRANTEE
For the above about how to obtain mysql user rights in batches, do you think it is very helpful? If you need to know more, please continue to follow our industry information. I'm sure you'll like it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.