我正在使用 WebMatrix 并在尝试在 MySQL 数据库中创建用户时卡在了第一位。
错误信息在一行:
var token = WebSecurity.CreateAccount(email, password, requireEmailConfirmation);
错误信息:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[UserId] FROM [UserProfile] WHERE (UPPER([Email]) = 'TE3ST@TEST.DE')'
我完全可以理解服务器正在尝试使用 SQL 格式查询到 MySQL 服务器。如何重新编译或告诉 WebSecurity.CreateAccount
使用 MySQL 格式的查询?
有什么想法吗?
提前谢谢你 克里希
最佳答案
WebSecurity helper 是 SimpleMembership Provider 的包装器,它不支持 MySQL(至少目前是这样)。它仅支持 SQL Server 和 SQL Compact 4.0。您可以编写自己的成员(member)提供程序,它继承了 ExtendedMembershipProvider如果您需要 MySQL 支持。
关于mysql - MySQL 的 WebSecurity.CreateAccount 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14770637/