WebSecurity.CreateAccount对于MySQL失败 [英] WebSecurity.CreateAccount fails for MySQL

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

问题描述

我正在使用WebMatrix并试图在MySQL数据库中创建用户时停留在第一位.

I am using WebMatrix and stuck at the first place while trying to create users in MySQL database.

错误消息在一行中:

var token = WebSecurity.CreateAccount(email, password, requireEmailConfirmation);

错误消息:

您的SQL语法有错误;检查与您的MySQL服务器版本相对应的手册,以获取正确的语法,以在'[UserId] FROM [UserProfile] WHERE(UPPER([Email])='TE3ST@TEST.DE')'附近使用

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')'

我可以完全理解该服务器正在尝试对MySQL服务器使用SQL格式的查询.如何重新编译或告诉WebSecurity.CreateAccount使用MySQL格式的查询?

I can fully understand that the server is trying to use SQL formatted query to MySQL server. How do I recompile or tell the WebSecurity.CreateAccount to use MySQL formatted queries?

有什么主意吗?

预先感谢您 克里希(Krish)

Thank you in advance krish

推荐答案

WebSecurity帮助程序是SimpleMembership Provider的包装,该Provider目前不支持MySQL(至少目前不支持).它仅支持SQL Server和SQL Compact 4.0.您可以编写自己的成员资格提供程序,该成员资格继承 ExtendedMembershipProvider 如果需要MySQL支持.

The WebSecurity helper is a wrapper around the SimpleMembership Provider which doesn't support MySQL (at the moment, at least). It only supports SQL Server and SQL Compact 4.0. You can write your own membership provider which inherits ExtendedMembershipProvider if you need MySQL support.

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

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