mysql 权限处理

这是对mysql 业务用户在权限处理中遇到的坑:

  之前在新建mysql 实例后会做两件事

  1、增加业务库

  2、为业务库增加一个与之对应的用户

create database appdb char set utf8;
create user app@'%' identified by 'app@1234';
grant all on appdb.* to app@'%';

 

可能存在的问题:

  1、如果实例开启了binlog 日志,业务用户在创建procedure的时候会报以下错误:

ERROR 1419 (HY000): You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

  为了解决这面的问题有两个方案可以解决:

  a、设置log_bin_trust_function_creators为on

  b、给业务用户一个super权限,根据提示b解决方案会更好。

grant super on *.* to app@'%';

 

 

 

----

posted on 2017-07-25 10:31  蒋乐兴的技术随笔  阅读(180)  评论(0编辑  收藏  举报

导航