Home Database Mysql Tutorial MySQL管理之用户权限

MySQL管理之用户权限

Jun 07, 2016 pm 05:26 PM
mysql permissions mysql user management User rights

MySQL用户管理mysql授权级别·全局级别·数据库级别(能否删除创建库·表级别·字段级别·储存过程、存储函数级别需要了解的三种权限类型·管理类·数据库访问类



                   |
+------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'test1'@'%' IDENTIFIED BY PASSWORD'*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9'  |
| GRANT CREATE ON `wpdb`.* TO'test1'@'%'                                                               |
| GRANT CREATE ON `abc`.* TO'test1'@'%'                                                                |
| GRANT SELECT, INSERT, CREATE ON `test1`.* TO'test1'@'%'                                              |
| GRANT CREATE ON `mysql`.`wpdb` TO 'test1'@'%'                                                        |
+------------------------------------------------------------------------------------------------------+
5 rows in set (0.00 sec)


                                                    |
| GRANT CREATE ON `abc`.* TO'test1'@'%'                                                                |
| GRANT SELECT, INSERT, CREATE, ALTER ON `test1`.* TO'test1'@'%'                                       |
| GRANT UPDATE (age) ON `test1`.`testtb` TO'test1'@'%'                                                 |
| GRANT CREATE ON `mysql`.`wpdb` TO'test1'@'%'                                                         |  
+------------------------------------------------------------------------------------------------------+
6 rows in set (0.00 sec)



mysql> showgrants for test1@'%';
+------------------------------------------------------------------------------------------------------+
| Grants for test1@%                                                                                  |
+------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'test1'@'%' IDENTIFIED BY PASSWORD '*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9' |
| GRANT CREATE ON `wpdb`.* TO'test1'@'%'                                                               |
| GRANT CREATE ON `abc`.* TO 'test1'@'%'                                                               |
| GRANT INSERT, CREATE, ALTER ON `test1`.* TO 'test1'@'%'                                              |
| GRANT UPDATE (age) ON `test1`.`testtb` TO'test1'@'%'                                                 |
| GRANT CREATE ON `mysql`.`wpdb` TO'test1'@'%'                                                         |
+------------------------------------------------------------------------------------------------------+
6 rows in set (0.00 sec)

一般来讲select都是读权限,一般可以赋予,,其他权限则都为写权限需要慎重考虑授权




本文出自 “心情依旧” 博客,请务必保留此出处

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Win11 user permissions setting tutorial: How to configure Win11 user permissions Win11 user permissions setting tutorial: How to configure Win11 user permissions Jan 29, 2024 pm 08:33 PM

Some users will create multiple accounts when using computers, but some users' accounts do not have permissions, which means some operations cannot be performed directly? How to set user permissions in Win11? Users who are not sure can come to this site to see related strategies. How to set user permissions in Win11 1. Directly create the run function through the shortcut key combination [win+R], then enter [netplwiz] in the search box and click OK. 3. In the properties window that opens, click Group Members in the upper menu bar. 5. A window prompt will appear. Just click [Yes] to log out and restart the account to complete the settings.

How to implement user login and permission control in PHP? How to implement user login and permission control in PHP? Jun 29, 2023 pm 02:28 PM

How to implement user login and permission control in PHP? When developing web applications, user login and permission control are one of the very important functions. Through user login, we can authenticate the user and perform a series of operational controls based on the user's permissions. This article will introduce how to use PHP to implement user login and permission control functions. 1. User login function Implementing the user login function is the first step in user verification. Only users who have passed the verification can perform further operations. The following is a basic user login implementation process: Create

Node.js development: How to implement user rights management functions Node.js development: How to implement user rights management functions Nov 08, 2023 am 09:17 AM

Title: Node.js Development: User Rights Management Function Implementation and Code Examples Abstract: As the complexity of web applications and systems continues to increase, user rights management has become an important function that cannot be ignored. This article will introduce how to implement user rights management functions in Node.js development and give specific code examples. Introduction: As an efficient and lightweight development platform, Node.js has a wide range of application scenarios. In the development of many Node.js applications, user rights management is often an essential function.

Reasons for Linux permission denied exception Reasons for Linux permission denied exception Feb 20, 2024 am 10:43 AM

The Linux operating system is an open source operating system that is widely used on various devices such as servers and personal computers. When using Linux, you often encounter "PermissionDenied" exceptions. This article will explore the causes of this exception and give specific code examples. Each file and directory in Linux has corresponding permission settings to control the user's read, write and execution permissions. Permissions are divided into three levels: user permissions, group permissions and other user permissions. When used

Windows 10 Home Edition standard user changed to administrator Windows 10 Home Edition standard user changed to administrator Feb 14, 2024 pm 09:12 PM

I upgraded to Windows 10 some time ago. I accidentally changed the administrator to a standard user a few days ago. I found that I couldn't open many software, couldn't play games, and couldn't perform operations related to the administrator. Then I finally found a way. Let's take a look. . Change the standard user of Windows 10 Home Edition to an administrator 1. First open the new notification in the lower right corner of the desktop and click All Settings 2. After opening, click Update and Maintenance 3. Click Recovery, click Restart Now under Advanced Startup 4. After restarting, Enter this interface, and then select Troubleshooting. 5. In the troubleshooting interface, click Advanced Options to open the interface. 6. Click Start Settings. There is a restart button under the interface. Click 7. Select 4 to start safe mode. 8. Click Afterwards, the system restarts,

PHP data filtering: Handling user permission verification PHP data filtering: Handling user permission verification Jul 28, 2023 pm 01:24 PM

PHP Data Filtering: Handling User Permission Verification User permission verification is an important security issue when developing web applications. Filtering user input data is one of the key steps in ensuring the data security of your application. PHP provides some built-in functions and filters that can help us effectively filter and validate user input data. Verifying User Permissions When dealing with user permission verification, we need to ensure that the user has been authenticated before performing certain sensitive operations. For example, when a user performs an administrator operation, we may need to check

Permission control in Yii framework: controlling user access permissions Permission control in Yii framework: controlling user access permissions Jun 21, 2023 pm 06:54 PM

In web applications, security is crucial. To protect the confidentiality of user data and applications, access control is necessary. In many cases, users only have access to the resources or information they need. The Yii framework's permission management component provides a simple and effective way to achieve this. The RBAC (Role-BasedAccessControl) solution of the Yii framework aims to define access control as permissions that are both clear and flexible. The core of the RBAC program is in the application

How to implement the statement to view user role permissions in MySQL? How to implement the statement to view user role permissions in MySQL? Nov 08, 2023 am 09:40 AM

How to implement the statement to view user role permissions in MySQL? MySQL is a popular relational database management system with a flexible permission management mechanism. In MySQL, users can be assigned different roles and assign specific permissions to each role. This article will introduce how to use MySQL statements to view user role permissions. In MySQL, you can use the following statement to view user role permission information: SHOWGRANTSFOR<username>;

See all articles