Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ 问题咨询 ] SQL server 连接异常 #135

Closed
flyingonthebed opened this issue Apr 18, 2019 · 11 comments
Closed

[ 问题咨询 ] SQL server 连接异常 #135

flyingonthebed opened this issue Apr 18, 2019 · 11 comments
Labels
question Further information is requested

Comments

@flyingonthebed
Copy link
Contributor

问题描述

连接SQL server 数据库时,提示:
local variable 'conn' referenced before assignment

文档中未对这部分进行说明,请问是否这部分功能可以正常使用。

archery 所在机器可以正常ping 通 SQL server 服务器。
image

版本信息

  • 应用版本/分支:Release v1.50
  • 部署方式:手工部署
@flyingonthebed flyingonthebed added the question Further information is requested label Apr 18, 2019
@flyingonthebed flyingonthebed changed the title [ 问题咨询 ] [ 问题咨询 ] SQL server 连接异常 Apr 18, 2019
@LeoQuote
Copy link
Collaborator

一般这个情况是连接失败, 请检查账号名和密码, 另外SQL server建议只添加 从库 ,主库相关的上线功能未实现。

@LeoQuote
Copy link
Collaborator

看你密码很长, 有比较大的概率是重复保存了密码导致密码二次加密,失效的问题

@flyingonthebed
Copy link
Contributor Author

我换了个短名字的也不行哎,有没有什么别的注意事项

@LeoQuote
Copy link
Collaborator

主要就是用户名密码的问题, 建议你用查询工具连接,尝试一下能不能连接成功, 先排除账号密码和填写错误的问题。

@flyingonthebed
Copy link
Contributor Author

flyingonthebed commented Apr 18, 2019

我用测试功能测试了一下,弹出来这个提示,但是 venv 中以及安装了 pyodbc,不知道是什么原因。
image

Requirement already satisfied: pyodbc==4.0.23 in /opt/archery/venv4archery/lib/python3.6/site-packages (from -r requirements.txt (line 15)) (4.0.23)

@hhyo
Copy link
Owner

hhyo commented Apr 18, 2019

驱动缺失,如果最开始就能提供错误日志就不用反复沟通了

https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server

问题解决后可以在wiki上面补充一个SqlServer的配置过程,wiki开放编辑

@LeoQuote
Copy link
Collaborator

LeoQuote commented Apr 18, 2019

哦忘记这个坑了,下次日志还是要给全....因为我是看的微软文档探索的pyodbc,所以完全忘了这茬。

我得空更新一下sql server的相关文档

@flyingonthebed
Copy link
Contributor Author

OK,可以登陆了

@flyingonthebed
Copy link
Contributor Author

我更新是提交pr 还是直接编辑?

@hhyo
Copy link
Owner

hhyo commented Apr 18, 2019

我更新是提交pr 还是直接编辑?

wiki没有pr ,直接编辑就行

@LeoQuote 看这个错误好像是conn.close()导致的,和其他engine一样加个close方法,前端应该就能直接反馈那个驱动错误了

@flyingonthebed
Copy link
Contributor Author

可以,我编辑一下:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants