无法打开登录 'MYData' 中请求的数据库。登录失败。

来源:百度知道 编辑:UC知道 时间:2024/05/03 05:25:52
我的sql2005中为什么总是提示这个错误哟:

无法打开登录 'MYData' 中请求的数据库。登录失败。
用户 'sa' 登录失败。

我的连接字符串:
<add key="SqlConnection" value="server=(local);uid=sa;pwd=110;database=MYData"/>
用户映射那些都映射起了的!~~sa也能登录到sql2005中,

请高手帮帮!~~兄弟在此谢谢了

打开SQL Server Management Studio Express,
右键点击服务器,选择Properties(属性),在弹出窗口中点击Security(安全)切换到安全面板,

将server authentication服务器认证从windows authentication mode(windows用户认证模式)

修改为Sql Server and Windows Authentication mode(Sql server和windows认证模式),ok。
打开security(安全性) -- logins(登录名) ,右键选中sa,选择properties(属性),点击Status(状态)切换到状态面板,将Login(登录)设置为Enabled(启用)。
通过以上设置即可搞定。如果还不行请检查其他原因,譬如防火墙等因素