Migrating an ABP database from SQL Server to MySQL

Source: Internet
Author: User

Summary: Before following some online tutorials, learned a little knowledge of ABP. Recently wanted to say migrate the default SQL Server data to MySQL

First, a wave of internet searches.

Installing MySql.Data.Entity

Then you need to install MySql.Data.Entity and mysql.data to your . EntityFramework and. Web Project. Then you need to change it . Web . config file for the project.

Open your DbContext configuration class (Configuration.cs) and use the following code in the constructor of the class:

SetSqlGenerator("MySql.Data.MySqlClient", new MySql.Data.Entity.MySqlMigrationSqlGenerator());
Configuring the connection string

In order to be able to use the MySQL database, you need to modify the connection string in the Web. config file. As shown below:

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

When you download the startup template, if you select Include Module Zero. There are some migration files that are included in your project, but these files are used for SQL Server migrations. Please open it . EntityFramework The Migrations folder in the project, and then delete the migrated files. The migration file starts with a timestamp. The name of the migrated file looks like this:201506210746108_abpzero_initial.

After deleting all the migrated files, select your . The Web project starts with the project, opens the VS package management console, and is selected in the Package management console . EntityFramework Project as the default project. Then execute the following command in the console:

"AbpZero_Initial"

Now you can use the following command to create the database:

Update-Database

一,OK 按照上述操作一波,,纳尼,出现了以下问题

And then on the internet a variety of search, have not searched for useful content. Finally Google to a relevant content

Is the latest version of the problem. Decisively down version to 6.8.8 there is no breach of security rules.

Version 6.8.8 and 6.9.10 are no problem.

These are the first pits I've stepped on.

Two, the following is the provider did not return a ProviderManifestToken string, and this is the drop. Habitual and search a wave. Find out what is said on the Internet. Then stop and look at innerexception. Information in the InnerException

Access was denied. Is the password wrong ... Finally found that the password is really wrong (no way.) Well, before the installation of MySQL, after the use of one after eating the soil. )

Last update-database.

 以上。。。欢迎批评指正

Migrating an ABP database from SQL Server to MySQL

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.