eosphoros-ai / DB-GPT

AI Native Data App Development framework with AWEL(Agentic Workflow Expression Language) and Agents
http://docs.dbgpt.cn
MIT License
13.75k stars 1.86k forks source link

[Bug] [pymssql] Adaptive Server is unavailable or does not exist #2005

Open DekieCheng opened 2 months ago

DekieCheng commented 2 months ago

Search before asking

Operating system information

Windows

Python version information

3.10

DB-GPT version

main

Related scenes

Installation Information

Device information

CPU memory 16 GB

Models information

LLM:tongyi_proxyllm EMBEDDING_MODEL=text2vec

What happened

image

What you expected to happen

in my side, I've tried in Python both 3.12 and 3.10, also facing the issue. in my environment, I tried it by below code, it works fine, but in DB-GPT side, it cannot work when i tried to create the MSSQL datasource under application manage model.

try:

建立连接

connection = pymssql.connect(server=server, user=username, password=password, database=database)

# 创建游标
cursor = connection.cursor()

# 执行简单的查询以测试连接
cursor.execute('SELECT @@VERSION')  # 查询 SQL Server 版本
row = cursor.fetchone()  # 获取一行结果
print('SQL Server Version:', row[0])  # 打印版本信息

# 关闭游标和连接
cursor.close()
connection.close()

except pymssql.Error as e: print("Error while connecting to SQL Server:", e)

How to reproduce

image

Additional context

No response

Are you willing to submit PR?