-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mysql backend table creation error using InnoDB and utf8 charset #512
Comments
@drampelt Can you try changing the type to |
Thanks for the suggestion, the table creates fine with |
Ok got vault working locally and as far as I can tell everything is working great with the primary key being |
Created pull request #522 to solve this |
Use varbinary instead of varchar for mysql, fixes #512
Still happening when using HA with Mysql Backend:
The vault table exists, but does HA mode try to create another table to store HA lock or something? (I didn't dig into the code) To reproduce, in conf file, just add |
I would suggest filing a new bug about this and then linking to it from the PR that added MySQL HA support. |
When using a mysql database with the utf8 charset and InnoDB engine, vault fails to create the table:
After some research, I discovered that this is due to the 767 byte limit of InnoDB prefixes. So the issue is that the primary key (vault_key) is a varchar with length 512, exceeding the 767 byte limit as mysql use 3 bytes per character in utf8.
I tried creating the table manually with a smaller length (255) that would fit in this limit, but unfortunately mysql still validates the size even when using
CREATE TABLE IF NOT EXISTS
and the table does already exist.The text was updated successfully, but these errors were encountered: