安装sqlserver数据库
微软的数据库sqlserver 一直以来都是windows版本的,但最近微软推出了基于linux 版本的sqlserver数据库,详细的安装步骤如下:参考官网
RHEL:在 Linux 上安装 SQL Server - SQL Server | Microsoft Learn
参照官网安装数据库和sqlcmd工具:我的环境为centos7.4 版本,2G内存的一个虚拟机。
备份
使用sqlcmd自带的功能: 命令行sqlcmd -? 可以查看sqlcmd 命令参数, /opt/mssql/bin/sqlservr --help 查看sqlserver参数如下所示
[root@localhost ~]# sqlcmd -?
Microsoft (R) SQL Server Command Line Tool
Version 17.2.0000.1 Linux
Copyright (c) 2012 Microsoft. All rights reserved.
usage: sqlcmd [-U login id] [-P password]
[-S server or Dsn if -D is provided]
[-H hostname] [-E trusted connection]
[-N Encrypt Connection][-C Trust Server Certificate]
[-d use database name] [-l login timeout] [-t query timeout]
[-h headers] [-s colseparator] [-w screen width]
[-a packetsize] [-e echo input] [-I Enable Quoted Identifiers]
[-c cmdend]
[-q "cmdline query"] [-Q "cmdline query" and exit]
[-m errorlevel] [-V severitylevel] [-W remove trailing spaces]
[-u unicode outp