Home  >  Article  >  Database  >  vs+mysql+ef配置方法_MySQL

vs+mysql+ef配置方法_MySQL

WBOY
WBOYOriginal
2016-06-01 12:58:44864browse

  这次的项目用的是MySQL数据库,但是ADO.NET实体数据模型默认是不支持MySQL数据库的,本文档将介绍如何让VS ADO.NET实体数据模型支持MySQL。

一、安装插件

1.VS插件

  mysql-for-visualstudio

  下载地址:http://dev.mysql.com/downloads/windows/visualstudio/

2..NET连接程序

  mysql-connector-net

  下载地址:http://dev.mysql.com/downloads/connector/net/

 

完成上述步骤,就可以在VS映射MySQL数据库了,效果如下图:

  \

此时,可以完成对本地的连接,但是远程连接会有一点问题。截图如下:

  \

二、设置MySQL远程连接

1.修改user表Host字段

  通过root登录MySQL,找到mysql数据库,找到user表

 

  \

  更新user表的Host字段,把localhost改为%。

 \

 

2重启MySQL服务

  重启下MySQL的服务,此时就可以远程连接了

  效果如下图:

 \

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Mysql分页_MySQLNext article:mysql索引建立和优化_MySQL