Setting up .NET MVC3 with MySQL

为君一笑 提交于 2019-12-10 11:18:37

问题


Hy Guys,

How can I configure the webconfig to access a mysql db using MVC 3?

To use SQLExpress I included this code to configure in an example...

<add name="MovieDBContext"
     connectionString="Server=.\SQLEXPRESS;
     Database=Movies;Trusted_Connection=true"
     providerName="System.Data.SqlClient" />

I'm using Entity Framework.

PS.: I don't want to automatically create tables with the MVC. I want to create them manually.

Thks!


回答1:


Take a look at this post, it seems like your best option is to use MySql Connector with EF

Using MySQL with Entity Framework

your connection string should look something like:

Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;



来源:https://stackoverflow.com/questions/4887372/setting-up-net-mvc3-with-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!