cenos7安装sqlserver

1、升级系统
yum update -y
2、安装yum-utils包
yum install -y yum-utils
3、增加数据库的yum仓库
yum-config-manager --add-repo https://packages.microsoft.com/config/rhel/7/mssql-server-2019.repo
4、安装sqlserver
yum install -y mssql-server
/opt/mssql/bin/mssql-conf setup

输入数字3。后面一路y,需要记住设置的sa密码。

5、启动服务
systemctl start mssql-server
ss -tnl
6、安装unixodbc
yum-config-manager --add-repo https://packages.microsoft.com/config/rhel/7/prod.repo
yum install -y mssql-tools unixODBC-devel

ln -s /opt/mssql-tools/bin/sqlcmd /usr/bin

sqlcmd -S localhost -U sa

#查看sqlserver的状态
systemctl status mssql-server

#停止sqlserver服务
systemctl stop mssql-server

#开启sqlserver服务
systemctl Start mssql-server

#停止并且禁止sqlserver自启动
systemctl stop mssql-server
systemctl disable mssql-server

#设置开机自启并启动sqlserver
systemctl enable mssql-server
systemctl start mssql-server

关闭系统密码登录,启用秘钥登录。

#导入用户的公钥
cd ~/.ssh
cat id_ras.pub >>authorized_keys

vi /etc/ssh/sshd_config

#增加:
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile      .ssh/authorized_keys
PasswordAuthentication no

systemctl restart sshd.service

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值