摘要:
Python脚本采集某一台SQL Server服务器数据的时候,突然遇到“Connection to the database failed for an unknown reason”错误,更详细的信息如下 Traceback (most recent call last): File "src/pymssql.pyx", line 636, in pymssql.connect Fi... 阅读全文
摘要:
关于Python的pymssql模块,之前研究时总结了“pymssql默认关闭自动模式开启事务行为浅析”这篇博客,但是在测试过程中又发现了几个问题,下面对这些问题做一些浅析,如有不足或不正确的地方,敬请指出。 1: pymssql的commit函数可以提交两次或多次 Connection.commit(): Commit current transaction. You must ... 阅读全文
摘要:
使用Python采集SQL Server数据库服务器磁盘信息时,遇到了一个错误“CONFIG statement cannot be used inside a user transaction.DB-Lib error message 20018, severity 16”,那么为什么遇到这个错误呢? 其实很简单,就是因为SQL Server事务中不允许使用RECONFIGURE,我们可以简单模... 阅读全文
摘要:
执行一个Python脚本的时候,报“IndentationError: unindent does not match any outer indentation level" 错误,搜索了一下相关资料,遇到这个错误,是因为新的Python语法中是不支持的代码对齐中,混用TAB和空格的。 # python get_mssql_job_info.py File "get_mssq... 阅读全文
摘要:
最近一段时间shell脚本写得很溜,很有成就感,一想到被自己落下的Python就感到十分心虚。开始坚持学习Python!先将自己的测试机器的Python升级到Python 3.6.6。简单整理、记录一下! 1:检查当前Linux版本&Python版本信息 # more /etc/redhat-release Red Hat Enterprise Linux Server releas... 阅读全文
摘要:
C:\Users\konglb>pythonPython 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 17:26:49) [MSC v.1900 32 bit (Intel)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> print 'hello, ... 阅读全文