OtterMind/Chat2DB · error · BusinessException
mysql.account.scopeUnsupported
mysql.account.scopeUnsupported
Error message
mysql.account.scopeUnsupported
What it means
Error "mysql.account.scopeUnsupported" thrown in OtterMind/Chat2DB.
Source
Thrown at chat2db-community-server/chat2db-community-plugins/chat2db-community-mysql/src/main/java/ai/chat2db/plugin/mysql/account/MysqlAccountSqlBuilder.java:140
static String scopeSql(AccountOperationRequest command) {
switch (PrivilegeScopeEnum.from(command.getScope())) {
case GLOBAL:
return ALL_DATABASE_ALL_TABLE_SCOPE;
case DATABASE:
if (StringUtils.isBlank(command.getDatabaseName())) {
throw new BusinessException(ERROR_KEY_ACCOUNT_DATABASE_REQUIRED);
}
return identifier(command.getDatabaseName()) + ALL_TABLE_SCOPE_SUFFIX;
case TABLE:
if (StringUtils.isBlank(command.getDatabaseName())) {
throw new BusinessException(ERROR_KEY_ACCOUNT_DATABASE_REQUIRED);
}
if (StringUtils.isBlank(command.getTableName())) {
throw new BusinessException(ERROR_KEY_ACCOUNT_TABLE_REQUIRED);
}
return identifier(command.getDatabaseName()) + SQLConstants.DOT + identifier(command.getTableName());
default:
throw new BusinessException(ERROR_KEY_ACCOUNT_SCOPE_UNSUPPORTED);
}
}
private static String scope(AccountOperationRequest command) {
return scopeSql(command);
}
private static String privilegeList(List<String> privileges) {
String sqlPrivileges = privileges.stream()
.filter(Objects::nonNull)
.distinct()
.map(MysqlPrivilege::sqlName)
.collect(Collectors.joining(SQLConstants.COMMA_SPACE));
if (StringUtils.isBlank(sqlPrivileges)) {
throw new BusinessException(ERROR_KEY_ACCOUNT_PRIVILEGE_REQUIRED);
}
return sqlPrivileges;
}View on GitHub (pinned to 5ee1e990e7)
Solutions
- Use a privilege scope supported by the MySQL account SQL builder: global, database, or table.
When it happens
Trigger: The SQL builder encountered a scope value it does not know how to render.
Common situations: See trigger scenarios.
AI-assisted analysis of OtterMind/Chat2DB@5ee1e990e7 (2026-08-14).
Data as JSON: /api/errors/24af0167dc6aa8fc.
Report an issue: GitHub.