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

13 Most Frequently Asked Vue Modifiers in Interviews

Table of contents 1. lazy 2.trim 3.number 4.stop ...

Non-standard implementation code for MySQL UPDATE statement

Today I will introduce to you a difference betwee...

Detailed explanation of system input and output management in Linux

Management of input and output in the system 1. U...

How to force vertical screen on mobile pages

I recently wrote a mobile page at work, which was...

Move MySQL database to another disk under Windows

Preface Today I installed MySQL and found that th...

Modify the boot time of grub in ubuntu

The online search to modify the grub startup time...

About the implementation of JavaScript carousel

Today is another very practical case. Just hearin...

Detailed explanation of mysql exists and not exists examples

Detailed explanation of mysql exists and not exis...

MySQL slow query and query reconstruction method record

Preface What is a slow query and how to optimize ...

Detailed tutorial for installing mysql5.7.21 under Windows

This article shares the installation tutorial of ...

Design Theory: Text Legibility and Readability

<br />Not long ago, due to business needs, I...

Detailed explanation of Linux netfilter/iptables knowledge points

Netfilter Netfilter is a packet processing module...