Some notes on mysql create routine permissions

Some notes on mysql create routine permissions

1. If the user has the create routine permission, he can create a procedure | function.

2. If a user creates a procedure | function, MySQL will automatically grant him the alter routine and execute permissions for the procedure | function.

3. Example:

User root creates a spuser@'localhost' user and grants it the create procedure permission

grant create routine on tempdb.* to spuser@'localhost' identified by '123456';

Create a routine with the spuser@'localhost' user

delimiter go
create procedure sp_hello_world()
begin
  select 'hello world';
end 
go

delimiter ;

Check the permissions of spuser@'localhost' again

mysql> show grants;
+---------------------------------------------------------------------------------------------------------------+
| Grants for spuser@localhost |
+---------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'spuser'@'localhost' IDENTIFIED BY PASSWORD '*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9' |
| GRANT CREATE ROUTINE ON `tempdb`.* TO 'spuser'@'localhost' |
| GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `tempdb`.`sp_hello_world` TO 'spuser'@'localhost' |
+---------------------------------------------------------------------------------------------------------------+

The above description of mysql create routine permissions is all I have to share with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed explanation of the solution to the error in creating a user and granting permissions in mysql8.0
  • How to open external network access rights for mysql
  • Detailed explanation of MySQL user rights verification and management methods
  • Summary of MySQL stored procedure permission issues
  • How to modify mysql permissions to allow hosts to access
  • Solution to the problem that the configuration file my.cnf in MySQL cannot be started due to permission issues
  • Detailed explanation of using Dockerfile to build MySQL image and implement data initialization and permission setting
  • Example of how to create a local user in mysql and grant database permissions
  • Enable remote access rights for MySQL under Linux and open port 3306 in the firewall
  • Mysql: The user specified as a definer (''xxx@''%'') does not exist solution

<<:  How to assign a public IP address to an instance in Linux

>>:  Problems with using wangeditor rich text editing in Vue

Recommend

This article helps you understand PReact10.5.13 source code

Table of contents render.js part create-context.j...

Example code for implementing background blur effect with CSS

Is it the effect below? If so, please continue re...

CSS positioning layout (position, positioning layout skills)

1. What is positioning? The position attribute in...

MySQL 8.0 installation tutorial under Linux

This article introduces how to install MySQL 8.0 ...

Detailed explanation of MySQL monitoring tool mysql-monitor

1. Overview mysql-monitor MYSQL monitoring tool, ...

Details of the underlying data structure of MySQL indexes

Table of contents 1. Index Type 1. B+ Tree 2. Wha...

Front-end JavaScript operation principle

Table of contents 1. What is a JavaScript engine?...

How to test network speed with JavaScript

Table of contents Preface Summary of the principl...

vue+rem custom carousel effect

The implementation of custom carousel chart using...

WeChat applet scroll-view realizes left and right linkage

This article shares the specific code for WeChat ...

CSS3 simple cutting carousel picture implementation code

Implementation ideas First, create a parent conta...

MYSQL string forced conversion method example

Preface Since the types of the same fields in the...

Nginx cache configuration example

When developing and debugging a web application, ...