Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How MySQl creates users and authorizations

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to create MySQl users and authorization, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Management of permissions:

How to create users and passwords

Authorize the current user

Remove the permissions of the current user

First, go to the mysql database:

Mysql > use mysqlDatabase changed

Secondly, add, delete and modify new users:

1. Create user: # specify the chao user of ip:192.118.1.1 to log in to create user 'chao'@'192.118.1.1' identified by' 123 user # specify ip:192.118.1. The beginning of the chao user logs in to create user 'chao'@'192.118.1.%' identified by' 123 users. # specifies any chao user of ip to log in to create user 'chao'@'%' identified by' 123 users; 2. Delete user drop user 'username' @'IP address'; 3. Modify the user rename user 'username' @'IP address'to 'new user name' @'IP address'; 4. Change the password set password for 'username' @'IP address'= Password ('new password')

Next, authorize the current user

# View permissions show grants for 'user' @'IP address'# authorize chao users to query, insert and update db1.t1 files only grant select, insert,update on db1.t1 to "chao" @'%'; # means all permissions, except for the command grant, this command is available only for root. Chao users have arbitrary actions on T1 files under db1 grant all privileges on db1.t1 to "chao" @'%'; # chao users perform any actions on files in db1 database grant all privileges on db1.* to "chao" @'%'; # chao users have any actions on files in all databases grant all privileges on *. * to "chao" @'%' # cancel permissions # cancel any operation of chao users on db1's T1 files revoke all on db1.t1 from 'chao'@ "%"; # cancel all permissions of chao users from remote servers on all tables of database db1; cancel permissions of all tables of database db1 of chao users from remote servers revoke all privileges on *. * from' chao'@'%' The above is all the content of the article "how MySQl creates users and authorizations". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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: 278

*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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report