Web2py - Oracle 连接失败
Web2py - Oracle Connection Failure
我正在尝试将 web2py 连接到我的本地 Oracle 数据库,从 pip3 安装了 cx_Oracle
并安装了 Oracle Instant Client。
echo $LD_LIBRARY_PATH
/usr/lib/oracle/19.6/client64/lib:
Web2py 版本 Version 2.19.1-stable+timestamp.2020.03.21.13.06.49
.
我的db.py,文件
db = DAL('oracle://username/password@test')
但出现此错误:
<class 'RuntimeError'> Failure to connect, tried 5 times: Traceback (most recent call last): File "/home/user/project/web2py/gluon/packages/dal/pydal/base.py", line 507, in __init__ self._adapter = adapter(**kwargs) File "/home/user/project/web2py/gluon/packages/dal/pydal/adapters/__init__.py", line 41, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File "/home/user/project/web2py/gluon/packages/dal/pydal/adapters/base.py", line 417, in __init__ super(SQLAdapter, self).__init__(*args, **kwargs) File "/home/user/project/web2py/gluon/packages/dal/pydal/adapters/base.py", line 85, in __init__ self.find_driver() File "/home/user/project/web2py/gluon/packages/dal/pydal/adapters/base.py", line 134, in find_driver "No driver of supported ones %s is available" % str(self.drivers) RuntimeError: No driver of supported ones ('cx_Oracle',) is available
谢谢。
在 ld.so.conf
文件中添加了 /usr/lib/oracle/19.6/client64/lib
:
#vim /etc/ld.so.conf
/usr/lib/oracle/19.6/client64/lib
然后:
sudo ldconfig
我正在尝试将 web2py 连接到我的本地 Oracle 数据库,从 pip3 安装了 cx_Oracle
并安装了 Oracle Instant Client。
echo $LD_LIBRARY_PATH
/usr/lib/oracle/19.6/client64/lib:
Web2py 版本 Version 2.19.1-stable+timestamp.2020.03.21.13.06.49
.
我的db.py,文件
db = DAL('oracle://username/password@test')
但出现此错误:
<class 'RuntimeError'> Failure to connect, tried 5 times: Traceback (most recent call last): File "/home/user/project/web2py/gluon/packages/dal/pydal/base.py", line 507, in __init__ self._adapter = adapter(**kwargs) File "/home/user/project/web2py/gluon/packages/dal/pydal/adapters/__init__.py", line 41, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File "/home/user/project/web2py/gluon/packages/dal/pydal/adapters/base.py", line 417, in __init__ super(SQLAdapter, self).__init__(*args, **kwargs) File "/home/user/project/web2py/gluon/packages/dal/pydal/adapters/base.py", line 85, in __init__ self.find_driver() File "/home/user/project/web2py/gluon/packages/dal/pydal/adapters/base.py", line 134, in find_driver "No driver of supported ones %s is available" % str(self.drivers) RuntimeError: No driver of supported ones ('cx_Oracle',) is available
谢谢。
在 ld.so.conf
文件中添加了 /usr/lib/oracle/19.6/client64/lib
:
#vim /etc/ld.so.conf
/usr/lib/oracle/19.6/client64/lib
然后:
sudo ldconfig