2020-10-30

pymssql + python 小白(出错了)

大家好!!!
pymssql连接数据库报错,python语句是:

connect = pymssql.connect(host="127.0.0.1", user='root',password="xiehao123")  # port=8080,
if connect:
    print(123)

报错信息为:

	D:\PyCharm2020\plant_scan\venv\Scripts\python.exe 	D:/PyCharm2020/plant_scan/123.py
	Traceback (most recent call last):
	  File "src\pymssql.pyx", line 636, in pymssql.connect
	  File "src\_mssql.pyx", line 1964, in _mssql.connect
	  File "src\_mssql.pyx", line 682, in _mssql.MSSQLConnection.__init__
	  File "src\_mssql.pyx", line 1690, in _mssql.maybe_raise_MSSQLDatabaseException
	_mssql.MSSQLDatabaseException: (18456, b"\xe7\x94\xa8\xe6\x88\xb7 'root' \xe7\x99\xbb\xe5\xbd\x95\xe5\xa4\xb1\xe8\xb4\xa5\xe3\x80\x82DB-Lib error message 20018, severity 14:\nGeneral SQL Server error: Check messages from the SQL Server\nDB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (127.0.0.1)\nDB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (127.0.0.1)\n")
	
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:/PyCharm2020/plant_scan/123.py", line 23, in <module>
    connect = pymssql.connect(host="127.0.0.1", user='root',password="xiehao123")  # port=8080,
  File "src\pymssql.pyx", line 642, in pymssql.connect
pymssql.OperationalError: (18456, b"\xe7\x94\xa8\xe6\x88\xb7 'root' \xe7\x99\xbb\xe5\xbd\x95\xe5\xa4\xb1\xe8\xb4\xa5\xe3\x80\x82DB-Lib error message 20018, severity 14:\nGeneral SQL Server error: Check messages from the SQL Server\nDB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (127.0.0.1)\nDB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (127.0.0.1)\n")

感谢哥哥姐姐帮着look look!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值