In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
What are the MySQL permission control statements? In order to give you a better understanding of MySQL access control statements, the editor summarizes the following, let's look down together.
MySQ permission control statement
1. Log in to the MySQL server using your root account:
Mysql-u root-pmypass
two。 Switch to the mysql database instance:
Use mysql
3. View the user table:
Select host, user, password from user
4. Create a user "yang" with a password of "yangpass" that is only allowed to log in from this machine:
Create user 'yang'@'localhost' identified by' yangpass'
5. Delete a native login user named "yang":
Drop user 'yang'@'localhost'
6. Create a user "yang" that allows login from any host with a password of "yangpass":
Create user 'yang'@'%' identified by' yangpass'
7. Change the password of the user "yang" who is allowed to log in from any host, the new password is "yan":
Set password for 'yang'@'%' = password (' yan')
8. Grant all permissions to yang_test 's library to a user named "yang" who is allowed to log in from any host:
Grant all privileges on yang_test.* to 'yang'@ "%"
9. Refresh permissions to make permission changes take effect:
Flush privileges
10. Create a user "remote" that allows login from any host with a password of "app":
Create user 'remote'@'%' identifed by' app'
11. The "remote" user grants CRUD permissions to the "t_weapon" table on the library "yang_test":
Grant select, delete, update, insert on yang_test.t_weapon to 'remote'
twelve。 Revoke all permissions of user "yang" on the "yang_test" library:
Revoke all privileges on yang_test.* from 'yang'@'%'
After reading the above, do you have a general understanding of MySQL access control statements? If you want to know more, please follow other related articles!
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.