linux安装mssql2019 本文共有2151个字,关键词: 根据原文:https://learn.microsoft.com/zh-cn/sql/linux/sql-server-linux-overview?view=sql-server-ver16 ```bash #centos 安装mssql-server sudo yum update -y sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2019.repo sudo yum install -y mssql-server sudo /opt/mssql/bin/mssql-conf setup systemctl status mssql-server ``` ```bash #安装sql工具 sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/7/prod.repo sudo yum install -y mssql-tools unixODBC-devel echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc source ~/.bashrc sqlcmd -S localhost -U SA ``` ```bash #启动代理 #获取机器名称 hostnamectl #写入host,建议有几个IP都写上 vim /etc/hosts "IP Address" "hostname" "IP Address" "hostname.domain.com" #SQL执行 EXEC sp_configure 'show advanced', 1; RECONFIGURE; EXEC sp_configure 'allow updates', 0; RECONFIGURE; EXEC sp_configure 'Agent XPs', 1; RECONFIGURE; GO sudo /opt/mssql/bin/mssql-conf set sqlagent.enabled true sudo systemctl restart mssql-server ``` ```bash #开启远程访问,将开放端口1433 firewall-cmd --zone=public --add-port=1433/tcp --permanent ``` ```bash declare @dbname nvarchar(100) declare @name varchar(250) declare @tmp varchar(40) select @tmp = round(10000*rand(),0) declare @time nvarchar(200) Select @time = Replace( CONVERT(varchar(100), GETDATE(), 120),'-',''); set @time = Replace(@time,' ','') set @time = Replace(@time,':','') set @dbname = 'db' set @name = '/database/backup/'+convert(varchar(50),getdate(),112)+'/' + @dbname + '_' + @time+'_'+@tmp +'_full.bak' BACKUP DATABASE @dbname TO DISK=@name WITH NOFORMAT ``` ```bash #UOS #导入公共存储库 GPG 密钥 wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - #注册 Microsoft SQL Server Ubuntu 存储库: curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2019.list | sudo tee /etc/apt/sources.list.d/mssql-server.list sudo apt-get update sudo apt-get install -y mssql-server sudo /opt/mssql/bin/mssql-conf setup ``` 「一键投喂 软糖/蛋糕/布丁/牛奶/冰阔乐!」 赞赏 × 梦白沙 (๑>ڡ<)☆谢谢老板~ 1元 2元 5元 10元 50元 任意金额 2元 使用微信扫描二维码完成支付 版权声明:本文为作者原创,如需转载须联系作者本人同意,未经作者本人同意不得擅自转载。 经验累积,CentOS 2022-10-24 评论 679 次浏览