OtterMind/Chat2DB · error · BusinessException
mysql.account.databaseRequired
mysql.account.databaseRequired
Error message
mysql.account.databaseRequired
What it means
Error "mysql.account.databaseRequired" 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:128
throw new BusinessException(ERROR_KEY_ACCOUNT_IDENTIFIER_REQUIRED);
}
return SQLConstants.BACK_QUOTE + name.replace(SQLConstants.BACK_QUOTE, ESCAPED_BACK_QUOTE) + SQLConstants.BACK_QUOTE;
}
static String stringLiteral(String value) {
if (value == null) {
throw new BusinessException(ERROR_KEY_ACCOUNT_LITERAL_REQUIRED);
}
return SQLConstants.SINGLE_QUOTE + value.replace(SQLConstants.BACKSLASH, ESCAPED_BACKSLASH).replace(SQLConstants.SINGLE_QUOTE, ESCAPED_SINGLE_QUOTE) + SQLConstants.SINGLE_QUOTE;
}
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);
}View on GitHub (pinned to 5ee1e990e7)
Solutions
- Set the database name for database-scoped grant/revoke operations.
When it happens
Trigger: A database-scoped privilege operation was requested without a database name.
Common situations: See trigger scenarios.
AI-assisted analysis of OtterMind/Chat2DB@5ee1e990e7 (2026-08-14).
Data as JSON: /api/errors/aec9fb6e91020143.
Report an issue: GitHub.