pycharm连接mssql报错ValueError怎么办?

python3.7pycharm2018.3.4代码:importpymssqlconn=pymssql.connect(host='LA2',database='tes... python3.7pycharm2018.3.4代码:import pymssqlconn = pymssql.connect( host='LA2', database='testbase')~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~运行报错:F:\!school\python\venv\Scripts\python.exe F:/!school/python/t05.pyF:/!school/python/t05.py:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working import pymssqlProcess finished with exit code -1073741819 (0xC0000005)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~debug报错:F:\!school\python\venv\Scripts\python.exe "F:\!school\!pycharm\PyCharm Community Edition 2018.3.4\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 60609 --file F:/!school/python/t05.pypydev debugger: process 18696 is connectingConnected to pydev debugger (build 191.6183.50)Traceback (most recent call last): File "F:\!school\!pycharm\PyCharm Community Edition 2018.3.4\helpers\pydev\pydevd.py", line 1741, in <module> main() File "F:\!school\!pycharm\PyCharm Community Edition 2018.3.4\helpers\pydev\pydevd.py", line 1735, in main globals = debugger.run(setup['file'], None, None, is_module) File "F:\!school\!pycharm\PyCharm Community Edition 2018.3.4\helpers\pydev\pydevd.py", line 1135, in run pydev_imports.execfile(file, globals, locals) # execute the script File "F:\!school\!pycharm\PyCharm Community Edition 2018.3.4\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "F:/!school/python/t05.py", line 5, in <module> database='testbase' File "src\pymssql.pyx", line 636, in pymssql.connect File "src\_mssql.pyx", line 1957, in _mssql.connect File "src\_mssql.pyx", line 675, in _mssql.MSSQLConnection.__init__ValueError: list.remove(x): x not in list 展开
 我来答
cnf1980
2019-06-05 · TA获得超过1.5万个赞
知道大有可为答主
回答量:1.2万
采纳率:54%
帮助的人:2615万
展开全部
要这样写:
pymssql.connect(host='数据库服务器地址',user='user',password='密码',database='数据库名称',charset='utf8')
MSSQL是要密码认证的,它不是SQLite这种轻量可不加密的数据库。
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式