未安装数据库的windows使用notebook连接docker中的Dameng
pip install jupyter
PS D:\doc\DM\Docker_notebook\dmPython> python setup.py install
Traceback (most recent call last):
File "D:\doc\DM\Docker_notebook\dmPython\setup.py", line 115, in <module>
if CheckDmHome(path):
^^^^^^^^^^^^^^^^^
File "D:\doc\DM\Docker_notebook\dmPython\setup.py", line 58, in CheckDmHome
file=open(str_pytemp,'w')
^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'd:\\doc\\DM\\Docker_notebook\\.venv\\Scripts\\Lib\\site-packages\\dpi.py'
PS D:\doc\DM\Docker_notebook> pip install dmPython
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting dmPython
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e1/78/eb9f812c7d731ad30c213602dfecf5d2441ba39be1cf7ceb4d3bb8c77e9c/dmPython-2.5.8-cp311-cp311-win_amd64.whl (7.5 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.5/7.5 MB 9.7 MB/s eta 0:00:00
Installing collected packages: dmPython
Successfully installed dmPython-2.5.8
>>> import dmPython
>>> conn = dmPython.connect('SYSDBA', 'SYSDBA', '192.168.0.193:5236')
>>> dmPython.apilevel
'2.0'
>>> cursor = conn.cursor()
>>> cursor.execute('select * from ALL_TABLES limit 1')
<builtins.DmdbCursor on <dmPython.Connection to SYSDBA@192.168.0.193:5236>>
>>> print(cursor.fetchall())
[('SYS', 'SYSOBJECTS', 'SYSTEM', None, 'SYSOBJECTS', 'VALID', None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, 'ENABLED', None, None, 'NO', 'IOT', 'N', None, None, None, None, None, 'DISABLED', 'YES', 'NO', None, None, None, None, None, None, None, None, None, 'YES', None, 'DISABLED')]
cd .\sqlalchemy2.0.0\
python .\setup.py install
pip list
pip install ipython-sql pip install jupyter
docker load -i dm8_20241022_x86_rh6_64_single.tar docker images
docker run -d \
-p 30236:5236 \
--restart=always \
--name=dm8_test \
--privileged=true \
-e LD_LIBRARY_PATH=/opt/dmdbms/bin \
-e PAGE_SIZE=16 \
-e EXTENT_SIZE=32 \
-e LOG_SIZE=256 \
-e UNICODE_FLAG=1 \
-e INSTANCE_NAME=dm8_test \
-v ./data:/opt/dmdbms/data \
dm8_single:dm8_20241022_rev244896_x86_rh6_64
%load_ext sql
%config SqlMagic.style = '_DEPRECATED_DEFAULT'
%sql dm+dmPython://SYSDBA:SYSDBA001@localhost:30236
%sql select * from ALL_TABLES limit 1;
官方社区地址:https://eco.dameng.com
文章
阅读量
获赞