简体   繁体   English

如何在Visual Studio的Asp Mvc中更改默认的“注册和登录”以使用MySql?

[英]How do I change the default Register and Login in Asp Mvc in Visual Studio to use MySql?

All right, I am trying to create a website login and register page. 好的,我正在尝试创建一个网站登录和注册页面。 I need the website to use MySQL, and The MySQL user table only has (so far) the columns for the id, username, and password (SHA-256 hashed), and no other columns at the moment. 我需要使用MySQL的网站,并且MySQL用户表(到目前为止)仅具有ID,用户名和密码(SHA-256散列)列,此刻没有其他列。

So what do I do, so the program will use MySQL server instead of Microsoft SQL server and can login with a Username instead of an E-mail? 那么该怎么办,程序将使用MySQL服务器而不是Microsoft SQL服务器,并且可以使用用户名而不是电子邮件进行登录?

I already have a MySQL connection in the Data Connection in Server Explorer, but the program will not use that database. 我已经在服务器资源管理器的“数据连接”中建立了MySQL连接,但是该程序不会使用该数据库。

Ide say what you need to do is look into adding MySQL as a storage provider in EntityFramework (EF). 例如,您需要做的就是将MySQL添加为EntityFramework(EF)中的存储提供程序。 With the new releases of EF they are looking to make it so that you don't have to use TSQL, that you can use other storage mechanisms. 他们正在使用EF的新版本,以使其不必使用TSQL,而可以使用其他存储机制。 It looks like currently there is a driver for MySQL (have a look at https://www.nuget.org/packages/MySql.Data.Entity/ ) 看起来目前有一个MySQL驱动程序(请查看https://www.nuget.org/packages/MySql.Data.Entity/

Also you could have a look at http://www.asp.net/identity/overview/getting-started/aspnet-identity-using-mysql-storage-with-an-entityframework-mysql-provider but just don't use the -pre tag like they specified as it looks like the driver is no longer in pre-release. 您也可以看看http://www.asp.net/identity/overview/getting-started/aspnet-identity-using-mysql-storage-with-an-entityframework-mysql-provider,但不要使用-pre标签就像它们指定的一样,因为看起来驱动程序不再处于预发行版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将ASP.NET MVC默认登录页面更改为通过用户名而不是电子邮件地址登录? - How do I change the ASP.NET MVC default login page to login by username instead of email address? 如何手动注册ASP.NET MVC控制器? - How do I manually register ASP.NET MVC controllers? 如何解决在加载ASP.NET MVC项目时挂起的Visual Studio? - How do I troubleshoot Visual Studio which is hanging when loading ASP.NET MVC project? 如何在 Visual Studio 2017 中设置默认浏览器? - How do I set the default browser in Visual Studio 2017? 如何在Visual Studio中正确显示MVC项目? - How do I make a MVC project appear properly in Visual Studio? 如何在没有EF的ASP MVC中创建登录/注册页面 - How to create Login/Register page in ASP MVC without EF ASP.NET MVC在登录/注销时更改默认路由 - ASP.NET MVC change default route on login/logout 如何在 ASP.NET MVC 中更改登录表单的默认验证消息? - How to change default validation messages of a login form in ASP.NET MVC? Visual Studio 2015-如何更改默认货币? - Visual studio 2015 - How to change default currency? 如何在Visual Studio 2015中注册.NET Core 1.1 RTM的自定义项目模板? - How do I register a custom Item Template for .NET Core 1.1 RTM with Visual Studio 2015?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM