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

Mysql Foundation (4) user Rights Management and root password recovery

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

Share

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

The mysql user consists of the user and hostname, which is indicated by 'user'@'hosst'. The user and permission information of mysql is stored in the mysql library.

Mysql database tables:

User # user account, global permissions

Db # Library-level permissions

Host # Host

Tables_priv # Table level permissions

Colums_priv # field-level permissions

Procs_priv # permissions related to stored procedures and stored functions

Proxies_priv # proxy user rights

Permission level:

Library level

Table level

Field level

Mysql user rights GRANT rights list ON database. Table 'user name' @ 'host address' IDENTIFIED BY 'password; # authorized user example: mysql > GRANT CREATE,SELECT ON *. * TO' tr'@'localhost' IDENTIFIED BY 'mypass'; REVOKE permission list ON database. Table FROM 'username' @ 'host address' # revoke authorization example: mysql > REVOKE SELECT ON *. * FROM 'tr'@'localhost'; mysql > SHOW GRANTS FOR' tr'@'localhost'; # View the authorization of the specified user mysql > SELECT USER,HOST,PASSWORD FROM mysql.user; # View all user information

Mysql permission list:

Mysql root password recovery vim my.cnf # modify profile [mysqld] skip-grant-tables # login database skips authorization table (required) skip-networking # forbids users from connecting from the network (for security purposes) service mysqld restart # restart mysql mysql > UPDATE user SET Password=PASSWORD ('root') WHERE User='root' # Update root password

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.

Share To

Database

Wechat

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

12
Report