【发布时间】:2015-09-04 08:30:04
【问题描述】:
我不知所措,我正在尝试从 Python 类连接到 Sybase-ASE 数据库。
首先是一些版本号:
- Python - 2.7(Anaconda 2.1.0 64 位版本)
- Python Sybase 库 - python-sybase 0.40pre2(包含在 Anaconda 中)
- Sybase - ASE 12.5.4
- Linux - 红帽 4.4.7-1
- Shell - Bash 3.2.25(1)-release (x86_64-redhat-linux-gnu) (LANG=en_GB.UTF-8)
- Pycharm - 社区版 4.0.4
代码在命令行中失败(无论是否设置了字符编码)并且在 Pycharm 中也失败了。
我正在执行这行代码:
db = Sybase.connect(server, username, password, database)
所有凭据都是合法的,并且可以在其他地方使用,但我收到的错误消息是:
Sybase.DatabaseError: Msg 2401, Level 11, State 2
Character set conversion is not available between client character set 'utf8' and server character set 'iso_1'.
Msg 2411, Level 10, State 1
No conversions will be done.
我的 Google-fu 建议这只是一个警告,可以忽略,但是我仍然需要调用结果来打开游标来访问数据库。
我无法控制数据库服务器配置。我可以在初始连接之前在 Python 或 python-sybase 库中进行本地设置以缓解此问题吗?
【问题讨论】:
标签: python linux bash pycharm sap-ase