Specific method of viewing user authorization information in mysql

Specific method of viewing user authorization information in mysql

Specific method:

1. Open Command Prompt

2. Enter the mysql -u root -p command and press Enter

3. Enter the correct password and enter the mysql command line

4. View user authorization information

SHOW GRANTS FOR 'root'@'localhost';

Check the authorization information for the user name root and the host name localhost.

Knowledge point expansion:

MySQL View the permissions granted by the user

In MySQL, how do you view the permissions a user has been granted? The permissions granted to users may be divided into global-level permissions, database-level permissions, table-level permissions, column-level permissions, and subroutine-level permissions. The specific categories are as follows:

Global Level

Global privileges apply to all databases in a given server. These permissions are stored in the mysql.user table. GRANT ALL ON *.* and REVOKE ALL ON *.* grant and revoke only global privileges.

Database level

Database privileges apply to all objects in a given database. These permissions are stored in the mysql.db and mysql.host tables. GRANT ALL ON db_name.* and REVOKE ALL ON db_name.* grant and revoke database privileges only.

Table Level

Table privileges apply to all columns in a given table. These privileges are stored in the mysql.tables_priv table. GRANT ALL ON db_name.tbl_name and REVOKE ALL ON db_name.tbl_name grant and revoke table privileges only.

Column level

Column permissions apply to a single column in a given table. These privileges are stored in the mysql.columns_priv table. When using REVOKE, you must specify the same columns as those being granted.

Subroutine level

CREATE ROUTINE, ALTER ROUTINE, EXECUTE, and GRANT privileges apply to stored routines. These privileges can be granted at the global level or at the database level. Also, except CREATE ROUTINE, these privileges can be granted at the subprogram level and are stored in the mysql.procs_priv table.

The above is the detailed content of the specific method of viewing user authorization information in MySQL. For more information on how to view user authorization information in MySQL, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • MySQL user creation and authorization method
  • MySql add user, authorization, change password and other statements
  • How to create, authorize, and revoke MySQL users
  • Sharing of methods for creating new users and authorization in MySQL
  • User authorization and authorization deletion methods in MySQL
  • mysql create database, add users, user authorization practical method
  • mysql5.7 create user authorization delete user revoke authorization
  • MySQL creates users, authorizes users, revokes user permissions, changes user passwords, and deletes users (practical tips)
  • Detailed explanation of creating, deleting users, and authorizing and removing rights in mysql8

<<:  Some data processing methods that may be commonly used in JS

>>:  How to use fdisk to partition disk in Linux

Recommend

How to run postgreSQL with docker

1. Install Docker. Reference URL: Docker Getting ...

Gitlab practical tutorial uses git config for related configuration operations

This article introduces the content related to gi...

Several ways to switch between Vue Tab and cache pages

Table of contents 1. How to switch 2. Dynamically...

Vue implements multi-grid input box on mobile terminal

Recently, the company has put forward a requireme...

Solve the problem of inconsistency between mysql time and system time in docker

Recently, when I installed MySQL in Docker, I fou...

Install multiple versions of PHP for Nginx on Linux

When we install and configure the server LNPM env...

Detailed explanation of the use of Vue image drag and drop zoom component

The specific usage of the Vue image drag and drop...

JavaScript to implement search data display

This article shares the data display code for Jav...

Implementing calculator functions with WeChat applet

This article is a simple calculator written using...

How to add automatic completion commands for docker and kubectl on Mac

Introduction to kubectl kubectl is a command line...

In-depth understanding of umask in new linux file permission settings

Preface The origin is a question 1: If your umask...

Common problems in implementing the progress bar function of vue Nprogress

NProgress is the progress bar that appears at the...

Mysql join query syntax and examples

Connection query: It is the result of connecting ...