gpt4 book ai didi

azure - 大容量复制程序 (bcp) 实用程序 - 导入 CSV 时出错 - 证书链由不受信任的机构颁发

转载 作者:行者123 更新时间:2023-12-03 06:13:30 24 4
gpt4 key购买 nike

我尚未成功使用 BCP 实用程序将 CSV 文件批量导入 Azure SQL Server。我继续收到错误证书链是由不受信任的机构颁发的

这是我的脚本/代码:

bcp DestinationDatabase.Table IN `
"C:\Data\CSVDataNeedingImported.csv" `
-c -G `
-U <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c0adb981bab5b2a595b3a5b28ea1ada580a4afada1a9aeeea3afad" rel="noreferrer noopener nofollow">[email protected]</a> `
-P $pass `
-S AzureServerName

我没有什么设置证书的经验。我需要知道下一步应该去哪里或做什么。我希望有人能够指出我正确的方向。

完全错误:

SQLState = 08001, NativeError = -2146893019
Error = [Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: The certificate chain was issued by an authority that is not trusted
.


SQLState = 08001, NativeError = -2146893019
Error = [Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection

PowerShell ISE 的屏幕截图:

PowerShell ISE BCP Certificate Chain Error

最佳答案

当我运行以下命令时

bcp DimDate2 in C:\Users\....\mycsvfile.csv -S knewserver -d  Mysqldb -U Kavya -P sjjhs@123 
Error:
SQLState = 08001, NativeError = 53
Error = [Microsoft][ODBC Driver 17 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [53].
SQLState = 08001, NativeError = 53
Error = [Microsoft][ODBC Driver 17 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or n
ot accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
SQLState = S1T00, NativeError = 0
Error = [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired

enter image description here

目标表必须包含与复制数据类似的表列

CREATE TABLE destb
(
name char NOT NULL,
rno TINYINT NOT NULL,

)
;

确保服务器已启用网络访问

enter image description here

我可以通过使用 -T 来克服错误

以下命令对我有用

bcp destb in C:\Users\...\mycsvfile.txt -S Knowserver.database.windows.net -d Mysqldb -U Kavya -P Sgfhgr@123 -q -c -t “,”

enter image description here

引用Load data from CSV file into a database (bcp) - Azure SQL | Microsoft Learn

关于azure - 大容量复制程序 (bcp) 实用程序 - 导入 CSV 时出错 - 证书链由不受信任的机构颁发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76508676/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com