CentOS 7:dmPython安装及测试连接达梦数据库

python下载地址:Python Source Releases | Python.org

查看数据库服务

dmPython 安装

cd /home/dmdba/dmdbms/drivers/python/dmPython
python setup.py install

[root@localhost dmPython]# python setup.py install
running install
running bdist_egg
running egg_info
writing dmPython.egg-info/PKG-INFO
writing top-level names to dmPython.egg-info/top_level.txt
writing dependency_links to dmPython.egg-info/dependency_links.txt
reading manifest file 'dmPython.egg-info/SOURCES.txt'
writing manifest file 'dmPython.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
creating build/bdist.linux-x86_64/egg
copying build/lib.linux-x86_64-2.7/dmPython.so -> build/bdist.linux-x86_64/egg
creating stub loader for dmPython.so
byte-compiling build/bdist.linux-x86_64/egg/dmPython.py to dmPython.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying dmPython.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying dmPython.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying dmPython.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying dmPython.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
creating 'dist/dmPython-2.3-py2.7-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing dmPython-2.3-py2.7-linux-x86_64.egg
Removing /usr/lib64/python2.7/site-packages/dmPython-2.3-py2.7-linux-x86_64.egg
Copying dmPython-2.3-py2.7-linux-x86_64.egg to /usr/lib64/python2.7/site-packages
dmPython 2.3 is already the active version in easy-install.pth

Installed /usr/lib64/python2.7/site-packages/dmPython-2.3-py2.7-linux-x86_64.egg
Processing dependencies for dmPython==2.3
Finished processing dependencies for dmPython==2.3

测试连接:

>>> import dmPython
/usr/lib64/python2.7/site-packages/dmPython-2.3-py2.7-linux-x86_64.egg/dmPython.py:3: UserWarning: Module dmPython was already imported from /usr/lib64/python2.7/site-packages/dmPython-2.3-py2.7-linux-x86_64.egg/dmPython.pyc, but /home/dmdba/dmdbms/drivers/python/dmPython is being added to sys.path
>>> conn=dmPython.connect(user='SYSDBA',password='SYSDBA',server='localhost',port='5236')
>>> cursor=conn.cursor()
>>> cursor.execute('select status$ from v$instance')
<__builtin__.DmdbCursor on <dmPython.Connection to SYSDBA@localhost:5236>>
>>> value=cursor.fetchall()
>>> value
[('OPEN',)]
>>> exit()

可能会遇到的问题记录:

1.安装过程中会遇到python版本与dmPython不匹配的问题,如果执行“python setup.py install”不成功,可以试下降低python的版本或者替换新的dmPython包

2.gcc未安装

 3.数据库环境变量未配置

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值