Skip to content
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

Reduce IdentityServer table field max lengths since they cause errors on MySQL #812

Closed
lszabados opened this issue Feb 16, 2019 · 4 comments

Comments

@lszabados
Copy link
Contributor

I notice that the entity ClientRedirectUri configured to use ClientId and RedirectUri as primary key, but property of ClientRedirectUri configured to 2000 maxlength. Then we got an error of 'Specified key was too long; max key length is 3072 bytes' when we try to update the database.

It's really not a good idea to use such a long key in database actually.

@hikalkan
Copy link
Member

It seems similar to #734
We should check it and fix also if there are similar PKs. Thanks.

@hikalkan
Copy link
Member

In the next release, you will need to add a migration if you are using EF Core.

@hikalkan hikalkan changed the title IdentityServer.EntityFrameworkCore MySQL Error Reduce IdentityServer table field max lengths since they cause errors on MySQL Feb 23, 2019
@hejiajun107
Copy link

hejiajun107 commented Sep 7, 2020

Still some fields stay are 200 maxlength such as in PersistedGrant in ConfigureIdentityServer and in ConfigureAuditLogging which will lead to this error

@seegreen
Copy link

seegreen commented Sep 20, 2020

In the next release, you will need to add a migration if you are using EF Core.

the problem still exists in version 3.1.2(Stable) ,

Here is the mysql character set:
Variable_name Value
character_set_client utf8mb4
character_set_connection utf8mb4
character_set_database utf8mb4
character_set_filesystem binary
character_set_results utf8mb4
character_set_server utf8
character_set_system utf8
character_sets_dir /u01/mysql57_20200630/share/charsets/

I solved the problem by changing the DB's variable 'innodb_large_prefix' to ON , the default value is OFF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants