Entity Framework 6+ Connection MySQL

Source: Internet
Author: User

All right. This blog is not open I feel. All the same.

Objective:

Company retrofit SQL Server->mysql Sql2016 I can't stand you. The good frontier is over.

Need the guy:

1.mysql-for-visualstudio

2.mysql-connector-net

3.mysql-connector-odbc

4.Vs (one of the most powerful Ides in history does not have a love who has no face)

Operation Steps:

1. Install the guys I said above (skip if you have one)

2. Take a cup of tea and start mining the pits.

3. The system prompts for no ef6+ message NuGet management to search the entity Framework and then install the latest version. (This time start tea craving, if you have installed the latest version please skip 2, 3 steps.) )

The PM command is as follows:

1 install-package entityframework-version 6.0.0 then enter to prompt for success
2 install-package entityframework.zh-hans-version 6.0.0 then enter to prompt for success
3 Install-package MySql.Data.Entity.EF6 (basic look character two times became)

4.Nuget Install Mysql.Data.Entity (sip, Kegua Zi, watch TV, masturbate code, watch the film. It's a bit long. I took a look at the bag-grab tool. As if I didn't tune the nuget image)

Ps: Here we despise the DLLs inside the NuGet pants. I use my own machine.

C:\Program Files (x86) \mysql\mysql Connector Net 6.9.9\assemblies\v4.5

5. Right-click Add data Model Select MySQL Conn then next.

PostScript above is Ef5,ef6 will appear your project references the latest Entity Framework; However, the version-compatible Entity Framework database that is required for the data link is not found

If the error!!!! Please select C:\Program Files (x86) \mysql\mysql Connector Net 6.9.9\assemblies\v4.5 do not nuget that good. Grandma has a leg.

Good! Claps! Write a data migration in two days.

6. This pit! As long as the new version of MySQL have!!! This hole!! It's a waste of time! This hole is a big hit! : An unexpected error occurred while Ef6 MySQL generated the model

Established conditional entity Framework (version 6.1.3) and MySQL Server (>= 5.7.6)

Nav connection on MySQL or direct powershell into MySQL input command:

Use <<database name>>;
Set global optimizer_switch= ' Derived_merge=off ';

    Re-refresh the EF EDM and then! We welcome you to shoot the bricks after the pit!

Entity Framework 6+ Connection 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.