Blazor(.NET CORE)에서 MySQL 사용
환경
VisualStudio2019
.NET CORE 3.1
MySQL8.0
절차
Blazor 앱 만들기


이번에는 인증을 개별 사용자 계정으로 둡니다.

SQLServer용 Migration 파일을 삭제합니다.

appsettings.json을 MySQL 용으로 다시 작성
appsettings.json
{
"ConnectionStrings": {
"DefaultConnection": "Server=localhost;user id=xxxx;password=xxxx;database=xxxx"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}
NuGet 패키지 관리에서 "Pomelo.EntityFrameworkCore.MySql"을 설치합니다.

""UseSqlServer"의 정의가 포함되지 않고 ..."오류가 발생하기 때문에 UseSqlServer를 "UseMySql"로 변경
[변경 전]

[변경 후]

패키지 관리자 콘솔에서 다음 명령 입력
add-migration 'identity'

계속해서 다음 명령을 입력
Update-Database
앱을 시작하고 사용자 등록하기
데이터가 등록되면 완료

참고 기사
Reference
이 문제에 관하여(Blazor(.NET CORE)에서 MySQL 사용), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/near108/items/cd975d961965fb9278be텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)