且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用用户名和密码连接到 SQL Server

更新时间:2022-03-15 15:34:08

首先检查你的数据库的认证模式:在 SSMS 上连接到您的数据库,右键单击它,转到属性",然后转到安全性".确保选择了SQL Server 和 Windows 身份验证模式".这将允许您创建登录名.

first check the authentication mode of your DB: connect to your DB on SSMS, right click it, go to "properties" and then "security". Make sure that "SQL Server and windows authentication mode" is selected. That will allow you to create logins.

然后创建您的登录名:在 SSMS 上连接到您的数据库,展开您的数据库,然后转到安全"并右键单击登录名,然后单击新登录名"

Then create your login: connect to your DB on SSMS, expand your database then go to "security" and right click on logins and then click "new login"

然后创建您的用户:转到数据库内的安全文件夹,右键单击用户和新用户".告知您之前创建的用户名和登录名.不要忘记添加必要的权限

then create your user: go to the security folder inside your DB, right click users and "new user". Inform the user name and the login name you previous created. Dont forget to add the necessary permissions

关于连接字符串,这是一个已经指出的非常好的网站:

About connection strings, this is a very good website as already pointed:

http://www.connectionstrings.com/