MySql sets the specified user database view query permissions

MySql sets the specified user database view query permissions

1. Create a new user:

1. Execute SQL statement to create a new one (recommended):

INSERT INTO `mysql`.`user` (
	`Host`,
	`User`,
	`Password`,
	`ssl_cipher`,
	`x509_issuer`,
	`x509_subject`,
	`authentication_string`
)
VALUES
(
	'%', -- Allow remote access 'zhangsan', -- User name '*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9', -- Plain text password: 123456
	'',
	'',
	'',
	''
);

select * from user where `user` = 'zhangsan';

2. Use tools to create:

insert image description here
insert image description here

2. Set permissions

1. Configure the database and data table (remember to save):

insert image description here

2. Set [Server Permissions] to revoke all

insert image description here

3. Refresh database permissions:

MariaDB [(none)]> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.000 sec)

4. Configure the connection:

insert image description here

3. Test permissions:

1. Test results show that the databases and tables without permissions have been blocked:

insert image description here

2. Test whether there is deletion permission:

insert image description here

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • SQL query statement to find the number of consecutive login days of a user
  • Detailed explanation of the process of querying user permissions using mysql statements
  • Detailed explanation of the idea of ​​Hive-SQL querying continuously active logged-in users

<<:  Several ways to easily traverse object properties in JS

>>:  Nginx local directory mapping implementation code example

Recommend

...

6 solutions to IDEA's inability to connect to the MySQL database

This article mainly introduces 6 solutions to the...

Use standard dl, dt, dd tags to discard table lists

Now, more and more front-end developers are starti...

Definition and function of zoom:1 attribute in CSS

Today I was asked what the zoom attribute in CSS ...

Detailed explanation of Docker Secret management and use

1. What is Docker Secret 1. Scenario display We k...

Vue directives v-html and v-text

Table of contents 1. v-text text rendering instru...

A brief discussion on the definition and precautions of H tags

Judging from the results, there is no fixed patte...

Detailed description of the function of new in JS

Table of contents 1. Example 2. Create 100 soldie...

Eight common SQL usage examples in MySQL

Preface MySQL continued to maintain its strong gr...

Detailed explanation of component development of Vue drop-down menu

This article example shares the specific code for...

Detailed explanation of the basic commands of Docker run process and image

Table of contents 1. Run workflow 2. Basic comman...

Vue3+TypeScript implements a complete example of a recursive menu component

Table of contents Preface need accomplish First R...