设置.NET MVC3与MySQL [英] Setting up .NET MVC3 with MySQL

查看:105
本文介绍了设置.NET MVC3与MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

海兰家伙,

我如何配置webconfig访问MySQL数据库使用MVC 3?

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

要使用SQLEx preSS我列入本code中的例子来配置...

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:我不希望自动创建与MVC表。我想手动创建它们。

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

Thks!

推荐答案

看看这个帖子,这似乎是最好的选择是使用MySQL连接器与EF

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

使用MySQL与实体框架

您的连接字符串应该是这个样子:

your connection string should look something like:

服务器= myServerAddress;数据库= MyDatabase的; UID =名为myUsername; PWD = MYPASSWORD;

这篇关于设置.NET MVC3与MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆