Using MySQL in the ABP template project

Source: Internet
Author: User
Tags mysql in connectionstrings

1 Download a new ABP template project

http://www.aspnetboilerplate.com/

2 install MySQL on Windows, create a new database SampleDb

Installation documentation for HTTPS://DEV.MYSQL.COM/DOC/REFMAN/8.0/EN/MYSQL-INSTALLER-GUI.HTML-MYSQL
https://downloads.mysql.com/archives/installer/-Mysql-installer-gui's

3 Open the template project and install the MySql.Data.Entity in EntityFramework and Web projects

Install-package mysql.data.entity-version 6.8.3/install-package MySql.Data.Entity-command to install MySql.Data.Entity components

Note: Do not install the latest version of MySql.Data.Entity here, because the template project uses the. NET Framework version is 4.5.2, the corresponding MySql.Data.Entity version to use 6.8.3, if you use the latest version, the following will be an error

4 modifying the Web. config file

<EntityFrameworkCodeconfigurationtype= "MySql.Data.Entity.MySqlEFConfiguration, MySql.Data.Entity.EF6">    <defaultconnectionfactorytype= "System.Data.Entity.Infrastructure.SqlConnectionFactory, entityframework" />    <providers>      <providerInvariantName= "MySql.Data.MySqlClient"type= "MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" />      <providerInvariantName= "System.Data.SqlClient"type= "System.Data.Entity.SqlServer.SqlProviderServices, entityframework.sqlserver" />    </providers>  </EntityFramework>  <connectionStrings><Addname= "Default"ProviderName= "MySql.Data.MySqlClient"connectionString= "server=localhost;port=3306;database=sampledb;uid=root;password=***" /></connectionStrings>

Refer to the documentation for EF6 to MYSQL http://dev.mysql.com/doc/connector-net/en/connector-net-entityframework60.html

5 executing commands in the package Manager console Update-database–verbos

6 You can now run the ABP template project.

Using MySQL in the ABP template project

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.