In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Basic Operation of Mysql based on linux operating system (3)
Knowledge point 1: view all users in MYSQL database
Command: select distinct concat ('User:''',user,'''@''',host,''';') as query from mysql.user
Note: (1) the keyword DISTINCT is used to return a unique different value.
Syntax: SELECT DISTINCT column name FROM table name
(2) the SQL CONCAT function is used to concatenate two strings to form a single string.
Compare the usage of the two:
Knowledge point 2: view the permissions of a specific user in the database
(1) Command: show grants for 'cacti'@'127.0.0.1'
The screenshot is as follows:
(2) Command: select * from mysql.user where user='cacti'\ G
The screenshot is as follows:
Knowledge point 3: to view the user table structure, specific items can be queried in combination with the table structure.
Command: desc mysql.user
The screenshot is as follows:
Knowledge point 4: delete users
Command: delete from mysql.user where user='cacti'and host='127.0.0.1'\ G
The screenshot is as follows:
Note: mysql > flush privileges; (refresh database)
Mysql > drop database testDB; / / Delete the user's database
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.