CentOS 7:dmPython安装及测试连接达梦数据库
创始人
2024-02-15 21:45:04
0

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 >
>>> value=cursor.fetchall()
>>> value
[('OPEN',)]
>>> exit()

可能会遇到的问题记录:

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

2.gcc未安装

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

相关内容

热门资讯

海南自贸区涨停潮背后:政策红利... 12月22日上午,A股市场迎来久违的“多点开花”——三大指数齐涨,而最引人注目的,莫过于海南自贸区板...
深圳:深入实施跨境贸易投资高水... 人民财讯12月23日电,深圳市人民政府印发《深圳市进一步加大吸引和利用外资实施办法》,其中提出,进一...
国家发展改革委等三部门完善幼儿... 中新网12月23日电 据国家发展改革委网站消息,近日,为深入贯彻党的二十大和二十届历次全会精神,落实...
建工修复(300958)披露累... 截至2025年12月23日收盘,建工修复(300958)报收于12.39元,较前一交易日下跌0.88...
红豆股份(600400)披露拟... 截至2025年12月23日收盘,红豆股份(600400)报收于2.4元,较前一交易日下跌2.83%,...
凌钢股份与江苏银行深圳分行纠纷... 12月23日,凌钢股份(600231)发布公告,近期公司收到辽宁省朝阳市中级人民法院的民事裁定书,案...
科蓝软件:科蓝盛合陷合同纠纷 ... 12月23日,科蓝软件(300663)发布公告,控股股东一致行动人宁波科蓝盛合投资管理合伙企业(有限...
广东潮州通报“因购物纠纷引发的... 本文转自【看潮州客户端】; 情况简讯 记者获悉,12月18日,在市区枫春路发生一起因购物纠纷引发的殴...