MySQL变量`max_allowed_pa​​cket`自动重置为1MB [英] MySQL variable `max_allowed_packet` auto resetting to 1MB

查看:98
本文介绍了MySQL变量`max_allowed_pa​​cket`自动重置为1MB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MySQL变量每天自动设置为1MB.我已经在MySQL配置中将其设置为256MB.我已启用常规查询日志以查看谁在更改变量,并发现有人触发了SET GLOBAL max_allowed_packet=1024来设置此变量.

MySQL variable auto setting to 1MB every day. I have already set it to the 256MB in MySQL config. I have enabled General query Log to see who is changing the variable and found that someone has fired SET GLOBAL max_allowed_packet=1024 to set this variable.

有什么方法可以防止用户从查询中设置此变量?

Is there any way to prevent user setting this variable from query?

如何撤消用户的权限以更新配置变量?

How to revoke privileges from user for updating config variables?

推荐答案

嗯,您应该撤消超级"特权.它授予使用SET GLOBAL的权限.

Ah, you should revoke "super" privileges. It gives permission to use SET GLOBAL.

REVOKE SUPER ON *.* FROM 'username'@'localhost';
FLUSH PRIVILEGES;

http://dev.mysql.com/doc/refman/5.7/en/privileges-provided.html#priv_super

这篇关于MySQL变量`max_allowed_pa​​cket`自动重置为1MB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆