如何将 Sysadmin 登录添加到 SQL Server? [英] How to add Sysadmin login to SQL Server?

查看:61
本文介绍了如何将 Sysadmin 登录添加到 SQL Server?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已在笔记本电脑中安装了使用 Windows 身份验证的 SQL Server 2008 供我自己使用.我想使用 SQL Server 登录类型添加 Sysadmin 帐户/角色.我查看了 .

评论后:

因此,从上面的链接更改为 Management Studio 中的混合模式:

<块引用>

  1. 在 SQL Server Management Studio 对象资源管理器中,右键单击服务器,然后单击属性.

  2. 在安全"页面的服务器身份验证"下,选择新的服务器身份验证模式,然后单击确定".

  3. 在 SQL Server Management Studio 对话框中,单击确定"以确认重新启动 SQL Server 的要求.

  4. 在对象资源管理器中,右键单击您的服务器,然后单击重新启动.如果 SQL Server 代理正在运行,则还必须重新启动它.

它应该看起来像这样:

I have installed SQL Server 2008 using Windows Authentication in my laptop for my own use. I want to add Sysadmin account/role using SQL Server Login type. I checked this post, but it's not showing what I need. How can I add the sysadmin account? By right shouldn't it be the default role/login?

解决方案

sysadmin is a server role; it can be applied to any login.

When installing SQL Server a login sa is created with this privilege; you can specify the password when you're installing SQL Server.

Or you can create your own login:

CREATE LOGIN adminuser WITH PASSWORD = 'ABCDegf123';
GO

EXEC master..sp_addsrvrolemember @loginame = N'adminuser', @rolename = N'sysadmin'
GO

This all assumes Mixed-Mode authentication is set up to allow SQL logins. Change Server Authentication Mode.

After comment:

So from the link above to change to Mixed-mode in Management Studio you would:

  1. In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.

  2. On the Security page, under Server authentication, select the new server authentication mode, and then click OK.

  3. In the SQL Server Management Studio dialog box, click OK to acknowledge the requirement to restart SQL Server.

  4. In Object Explorer, right-click your server, and then click Restart. If SQL Server Agent is running, it must also be restarted.

It should look something like this:

这篇关于如何将 Sysadmin 登录添加到 SQL Server?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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