Search code examples
abp-framework

Use MySql in ABP vnext framework


I want to use MySQL with ABP vnext. I spend many hours to find solution but i found nothing. I read documents and google the issue but did not find any solution.


Solution

  • You can use MySQL by using Volo.Abp.EntityFrameworkCore.MySQL package.

    1. In your .EntityFrameworkCore project, replace Volo.Abp.EntityFrameworkCore.SqlServer (considering you have created a default project) nuget package with Volo.Abp.EntityFrameworkCore.MySQL.
    2. Replace module dependencies in YourProjectNameEntityFrameworkCoreModule from typeof(AbpEntityFrameworkCoreSqlServerModule) to typeof(AbpEntityFrameworkCoreMySQLModule) with also replacing namespaces (using Volo.Abp.EntityFrameworkCore.SqlServer; to using Volo.Abp.EntityFrameworkCore.MySQL;)
    3. In your .EntityFrameworkCore project, replace UseSqlServer() with UseMySql() in YourProjectNameEntityFrameworkCoreModule.cs file.

    Here is official docs about switching to MySQL Provider.

    You can also check switching to an other dbms docs for other dbms supports.