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!