Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Sharing: Using MySql in ABP sample project #2110


User avatar
0
lcyhjx created

Sharing: Using MySql in ABP sample project

1 Download sample project from ABP website 2 Install MySql on windows, create a database named ‘sampledb’ <a class="postlink" href="https://dev.mysql.com/doc/refman/8.0/en/mysql-installer-gui.html">https://dev.mysql.com/doc/refman/8.0/en ... r-gui.html</a> <a class="postlink" href="https://downloads.mysql.com/archives/installer/">https://downloads.mysql.com/archives/installer/</a> 3 Install MySql.Data.Entity in EntityFramwwork and Web Projects Install-Package MySql.Data.Entity -Version 6.8.3 / Install-Package MySql.Data.Entity Please ensure don't install the laest version of MySql.Data.Entity, since the ABP sample project using .net framework 4.5.2, it will cause some exceptions

4 Change web.config in Web Project <entityFramework codeConfigurationType="MySql.Data.Entity.MySqlEFConfiguration, MySql.Data.Entity.EF6"> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /> <providers> <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" /> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> </providers> </entityFramework>

<connectionStrings> <add name="Default" providerName="MySql.Data.MySqlClient" connectionString="server=localhost;port=3306;database=sampledb;uid=root;password=*** " /> </connectionStrings>

<a class="postlink" href="http://dev.mysql.com/doc/connector-net/en/connector-net-entityframework60.html">http://dev.mysql.com/doc/connector-net/ ... ork60.html</a>

5 Run Update-Database –Verbos 6 Then you can run the sample ABP project successfully.


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @lcyhjx,

    Thank you very much for sharing your experience :).