pycharm 连接数据库报错[通俗易懂]

2022-09-25 13:39:39 浏览数 (1)

大家好,又见面了,我是你们的朋友全栈君。


pycharm 连接数据库报错

请问出现下面报错是什么原因呢,数据库已连接,运行后就这样了


C:UsersMACHENIKEPycharmProjectsuntitled9venvScriptspython.exe C:/Users/MACHENIKE/PycharmProjects/untitled11/venv/Online-Bookstore-Management-System-master/v1.0/Book_informationUI.py Traceback (most recent call last): File “srcpymssql.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”xe7x94xa8xe6x88xb7 ‘SA’ xe7x99xbbxe5xbdx95xe5xa4xb1xe8xb4xa5xe3x80x82DB-Lib error message 20018, severity 14:nGeneral SQL Server error: Check messages from the SQL ServernDB-Lib error message 20002, severity 9:nAdaptive Server connection failed (localhost)nDB-Lib error message 20002, severity 9:nAdaptive Server connection failed (localhost)n”)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “C:/Users/MACHENIKE/PycharmProjects/untitled11/venv/Online-Bookstore-Management-System-master/v1.0/Book_informationUI.py”, line 173, in Book_informationUI = Book_informationUI() File “C:/Users/MACHENIKE/PycharmProjects/untitled11/venv/Online-Bookstore-Management-System-master/v1.0/Book_informationUI.py”, line 20, in init self.initUI() File “C:/Users/MACHENIKE/PycharmProjects/untitled11/venv/Online-Bookstore-Management-System-master/v1.0/Book_informationUI.py”, line 24, in initUI self.connect = pymssql.connect(server, user, password, database) # 服务器名,账户,密码,数据库名 File “srcpymssql.pyx”, line 642, in pymssql.connect pymssql.OperationalError: (18456, b”xe7x94xa8xe6x88xb7 ‘SA’ xe7x99xbbxe5xbdx95xe5xa4xb1xe8xb4xa5xe3x80x82DB-Lib error message 20018, severity 14:nGeneral SQL Server error: Check messages from the SQL ServernDB-Lib error message 20002, severity 9:nAdaptive Server connection failed (localhost)nDB-Lib error message 20002, severity 9:nAdaptive Server connection failed (localhost)n”)

Process finished with exit code 1

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/172939.html原文链接:https://javaforall.cn

0 人点赞