---
title: 搭建MySQL+MGR单主模式时提示--super-read-only选项正在使用的解决方法
description: "搭建MySQL 8.0.18+MGR单主模式过程中，执行alter user 'repl'@'%' IDENTIFIED WITH caching_sha2_password;后提示“The MySQL server is running with the --super-read-only option so it cannot execute this statement”。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengdbs/troubleshooting/trouble/boostkit_database_troublecase_012.html
sourcePath: /source/zh/kunpengdbs/troubleshooting/trouble/boostkit_database_troublecase_012.html
indexId: 709728cce2e8909c5c266aa55664501a3a810773bf5ecc5c2bb9e73addada65b84
---
# 搭建MySQL+MGR单主模式时提示--super-read-only选项正在使用的解决方法

#### 问题现象描述

搭建MySQL 8.0.18+MGR单主模式过程中，执行alter user 'repl'@'%' IDENTIFIED WITH caching_sha2_password;后提示“The MySQL server is running with the --super-read-only option so it cannot execute this statement”。


#### 关键过程、根本原因分析

主库设置了只读模式，需要关闭只读模式的设置。


#### 结论、解决方案及效果

1. 关闭主库的只读模式。
  1 set global read_only=OFF;

2. 重新执行本例中对应的命令。
  1 alter user 'repl'@'%' IDENTIFIED WITH caching_sha2_password;
