# SQL服务器安装准备 1. 创建好SQL服务器后,配置好IP,将DNS指向域控服务器 ![image-20230407101125950](assets/image-20230407101125950.png) 2. 计算机命名并加域 ![image-20230407101253507](assets/image-20230407101253507.png) 3. 为此服务器挂一块500G的D盘,用户存储数据库: ![image-20230407101727732](assets/image-20230407101727732.png) ![image-20230407102001754](assets/image-20230407102001754.png) ![image-20230407102511902](assets/image-20230407102511902.png) 4. 创建一个Sqladmin的数据库专用域帐号,并且给提供Domain admin权限,**这里是在server-102上面操作** ![image-20230407104003701](assets/image-20230407104003701.png) ![image-20230407104122052](assets/image-20230407104122052.png) ![image-20230407104429415](assets/image-20230407104429415.png) 5. 登陆成功后点击“服务器管理器”-“添加角色和功能”,选择“故障转移群集”,在弹出的向导中点击添加功能,然后下一步 ![image-20230407104757832](assets/image-20230407104757832.png) 6. 选择自动重启 ![image-20230407104836517](assets/image-20230407104836517.png) # SQL数据库安装 1. 接下来开始安装SQL数据库,挂载对应的CD,选择“Setup”开始安装 ![image-20230407111445614](assets/image-20230407111445614.png) 2. 输入安装密钥,下一步 ![image-20230407111611516](assets/image-20230407111611516.png) ![image-20230407111731092](assets/image-20230407111731092.png) 3. 先打开控制面板里的防火墙设置,关闭防火墙,然后下一步 ![image-20230407111942695](assets/image-20230407111942695.png) 4. 选择功能 ![image-20230407112106206](assets/image-20230407112106206.png) 5. 直接下一步 ![image-20230407112202109](assets/image-20230407112202109.png) 6. 选择混合格式,输入两次相同的SA密码,点击添加当前用户,然后再点击数据目录,**这里也需要添加ctx作为管理员** ![image-20230407112341875](assets/image-20230407112341875.png) 7. 只需要将数据根目录的C改为D即可,下方会自动跟随变更,下一步 ![image-20230407112406616](assets/image-20230407112406616.png) 8. 点击“安装” ![image-20230407112522077](assets/image-20230407112522077.png) # 安装Studio 1. 在某台SQL服务器安装Studio管理工具,这里选择SQL1 ![image-20230411100803091](assets/image-20230411100803091.png) 2. 安装完成后点击重启,在开始菜单找到:Microsoft SQL Server Manager管理工具 ![image-20230411111059727](assets/image-20230411111059727.png) 3. 使用登陆的SQLADMIN域帐号认证登陆,SQL1数据库 ![image-20230411111233785](assets/image-20230411111233785.png) 4. 选择“数字引擎” ![image-20230411111643500](assets/image-20230411111643500.png) 5. 在服务名称输入:SQL的计算机名,同样也是使用SQLADMIN域帐号登陆 ![image-20230411111753383](assets/image-20230411111753383-16811830742011.png) 6. 授权ctx帐号的访问权限 ![image-20230411111839093](assets/image-20230411111839093.png) 7. 输入要授权的域帐号 ![image-20230411111955926](assets/image-20230411111955926.png) 8. 赋予“sysadmin”的权限 ![image-20230411112057520](assets/image-20230411112057520.png)