文档首页/ 云数据库 RDS/ 故障排除/ RDS for MySQL/ 参数类/ 命令行修改MySQL global参数失败
更新时间:2022-10-26 GMT+08:00

命令行修改MySQL global参数失败

场景描述

修改MySQL global参数失败:

MySQL [(none)]> show variables like 'binlog_expire_logs_seconds';
+----------------------------+-------+
| Variable_name              | Value |
+----------------------------+-------+
| binlog_expire_logs_seconds | 3600  |
+----------------------------+-------+
1 row in set (0.00 sec) 
MySQL [(none)]> set global binlog_expire_logs_seconds=600;
ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER or SYSTEM_VARIABLES_ADMIN privilege(s) for this operation 
MySQL [(none)]>

解决方案

RDS for MySQL不支持在数据库中执行修改全局参数的命令,您可以到控制台修改参数。详见是否支持使用SQL命令修改全局参数