[英]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.