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

vue.js Router nested routes

Preface: Sometimes in a route, the main part is t...

Vue implements user login and token verification

In the case of complete separation of the front-e...

A brief discussion on React native APP updates

Table of contents App Update Process Rough flow c...

Analysis of basic usage of ul and li

Navigation, small amount of data table, centered &...

Shell script nginx automation script

This script can satisfy the operations of startin...

How to add indexes to MySQL

Here is a brief introduction to indexes: The purp...

CSS3 animation to achieve the effect of streamer button

In the process of learning CSS3, I found that man...

Vue integrates Tencent Map to implement API (with DEMO)

Table of contents Writing Background Project Desc...

Docker image export, import and copy example analysis

The first solution is to push the image to a publ...

Summary of Mysql-connector-java driver version issues

Mysql-connector-java driver version problem Since...

How to use docker to deploy dubbo project

1. First, use springboot to build a simple dubbo ...

Detailed explanation of Mybatis special character processing

Preface: Mybatis special character processing, pr...

The difference and usage of Vue2 and Vue3 brother component communication bus

Table of contents vue2.x vue3.x tiny-emitter plug...