When using the MySQL/MariaDB Database Plugin with older MariaDB or MySQL server versions, you could encounter an error such as the following when reading from a role to obtain credentials:
$ vault read database/creds/readonly Error reading database/creds/readonly: Error making API request. URL: GET http://127.0.0.1:8200/v1/database/creds/readonly Code: 500. Errors: * 1 error occurred: * Error 1470: String 'v-user-readonly-74zse3283ndhkf' is too long for user name (should be no longer than 16)
Versions of Vault 0.8.1 and beyond provide an alternative to the
mysql-database-plugin named the
mysql-legacy-database-plugin that generates usernames with a maximum of 16 characters.
mysql-legacy-database-plugin for the value of
plugin_name when configuring the database plugin to use the alternative version and resolve this issue.