原 sqlcmd备份MSSQL数据库报错 SSL Provider: [error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:self signed certificate]
Tags: 原创故障处理MSSQLSQL Serversqlcmd
现象
1 2 3 4 5 6 7 | [root@alldb mssql]# sqlcmd -S 192.18.1.79,1436 -U sa -P lhr -Q "BACKUP DATABASE lhrdb TO DISK = N'D:\bk\lhrdb_$CURR_DATE.bak' WITH FORMAT, INIT;" Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : SSL Provider: [error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:self signed certificate]. Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : Client unable to establish connection. For solutions related to encryption errors, see https://go.microsoft.com/fwlink/?linkid=2226722. [root@alldb mssql]# telnet 192.18.1.79 1436 Trying 192.18.1.79... Connected to 192.18.1.79. Escape character is '^]'. |
解决
使用 -C
选项来启用信任服务器证书的设置。