OtterMind/Chat2DB · error · BusinessException
mysql.account.literalRequired
mysql.account.literalRequired
Error message
mysql.account.literalRequired
What it means
Error "mysql.account.literalRequired" 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:117
validateAccountPart(user, ERROR_KEY_ACCOUNT_USER_REQUIRED);
validateAccountPart(host, ERROR_KEY_ACCOUNT_HOST_REQUIRED);
return stringLiteral(user) + SQLConstants.AT + stringLiteral(host);
}
static String showGrantsSql(String user, String host) {
return SQL_SHOW_GRANTS_FOR + account(user, host);
}
static String identifier(String name) {
if (StringUtils.isBlank(name)) {
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())) {View on GitHub (pinned to 5ee1e990e7)
Solutions
- Supply the required string literal, such as a password or option value, for the account statement.
When it happens
Trigger: The account SQL builder needed a literal value that was missing.
Common situations: See trigger scenarios.
AI-assisted analysis of OtterMind/Chat2DB@5ee1e990e7 (2026-08-14).
Data as JSON: /api/errors/f507cf9a0f718de1.
Report an issue: GitHub.