Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Unable to seed my table in mysql for authorisation in asp.netcore 3.1

$
0
0

Dear All,

I am using mysql has my database. I actually dont have this problem when I use MSSQL. so the issue is I activated my project to use the default authorisation scheme which is meant to create the default users and roles table.

But unfortunately I am gettting a strange error

CREATE TABLE `AspNetUserLogins` (
    `LoginProvider` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
    `ProviderKey` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
    `ProviderDisplayName` longtext CHARACTER SET utf8mb4 NULL,
    `UserId` bigint NOT NULL,
    CONSTRAINT `PK_AspNetUserLogins` PRIMARY KEY (`LoginProvider`, `ProviderKey`),
    CONSTRAINT `FK_AspNetUserLogins_AspNetUsers_UserId` FOREIGN KEY (`UserId`) REFERENCES `AspNetUsers` (`Id`) ON DELETE CASCADE
)

MySQL said: Documentation
#1071 - Specified key was too long; max key length is 1000 bytes

So I tried following this tutorials

https://thienn.com/change-primary-key-aspnetcore-identity-and-more/

It worked but some other tables are still displaying the error like one I pasted above. Been strugling with this for 2 hours Please any help.

Dont forget am using Mysql. Mssql most likely wont give this error. I am using Pomelo.EntityframeworkCore ORM library

Thanks alot.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>