---
title: "mysql中权限小结"
author: "tarsean"
date: "2015-11-30T16:43:33Z"
tags: []
categories: ["数据库"]
slug: "mysql"
draft: false
lastmod: "2015-11-30T16:43:33Z"
id: 2260584
url: "https://tarsean.iteye.com/blog/2260584"
---

1、授权

grant all privileges on db.* to 'cycloud'@'%' identified by 'password'; 

flush privileges;

 

具体的权限列表：select,delete,create

 

授权用户：

% 表示所有非本机的主机

localhost 本机

192.168.%.%

 

 

grant select on mysql.proc to 'user'@'%'; 如果有存储过程，必须要单独设置该权限

否则报错：User does not have access to metadata required to determine stored procedure parameter types

 

2、存储过程权限

存储过程权限有两部分组成：

1） 调用者的权限

2） 定义者的权限

 

调用者必须要有execute的权限

定义者必须有存储过程调用以及其中使用的所有权限