Comments (4)
Sorry sinfex but this is not true, this functionality exists since the first version.
client = pyorient.OrientDB("localhost", 2424)
cluster_info = client.db_open(
'GratefulDeadConcerts', "admin", "admin"
)
print(cluster_info)
[{'name': b'e', 'id': 10}, {'name': b'index', 'id': 1}, {'name': b'orole', 'id': 4}, {'name': b'v', 'id': 9}, {'name': b'ofunction', 'id': 7}, {'name': b'default', 'id': 3}, {'name': b'manindex', 'id': 2}, {'name': b'orids', 'id': 6}, {'name': b'ouser', 'id': 5}, {'name': b'internal', 'id': 0}, {'name': b'followed_by', 'id': 11}, {'name': b'oschedule', 'id': 8}]
from pyorient.
I am sorry, but that does not seem to be true. I have tested it several times with python-3.4.1, orientdb-2.0-m3 and a recently forked version of pyorient. I have just tested it out again just in case, using a different server with a fresh installation of python 2.7.5, orientdb 1.7.10 and pyorient 1.2.1, the result is the same.
[dave@studs bin]$ sudo pip install pyorient
Downloading/unpacking pyorient
Downloading pyorient-1.2.1.tar.gz (47kB): 47kB downloaded
Running setup.py (path:/tmp/pip_build_root/pyorient/setup.py) egg_info for package pyorient
Installing collected packages: pyorient
Running setup.py install for pyorient
Successfully installed pyorient
Cleaning up...
[dave@studs bin]$ python2
Python 2.7.5 (default, Jun 17 2014, 18:11:42)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyorient
>>> client = pyorient.OrientDB("localhost", 2424)
>>> cluster_info = client.db_open('GratefulDeadConcerts', "admin", "admin")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/pyorient/orient.py", line 191, in db_open
.prepare(args).send().fetch_response()
File "/usr/lib/python2.7/site-packages/pyorient/messages/database.py", line 91, in prepare
self._perform_connection()
File "/usr/lib/python2.7/site-packages/pyorient/messages/database.py", line 63, in _perform_connection
.prepare( ( self._user, self._pass, self._client_id ) )\
File "/usr/lib/python2.7/site-packages/pyorient/messages/connection.py", line 54, in fetch_response
self._session_id = super( ConnectMessage, self ).fetch_response()[0]
File "/usr/lib/python2.7/site-packages/pyorient/messages/base.py", line 137, in fetch_response
self._decode_all()
File "/usr/lib/python2.7/site-packages/pyorient/messages/base.py", line 121, in _decode_all
self._decode_header()
File "/usr/lib/python2.7/site-packages/pyorient/messages/base.py", line 109, in _decode_header
raise PyOrientCommandException(cmd_exc, [])
pyorient.exceptions.PyOrientCommandException: Wrong user/password to [connect] to the remote OrientDB Server instance. Get the user/password from the config/orientdb-server-config.xml file - com.orientechnologies.orient.core.exception.OSecurityAccessException
Would you please double check? The only two explanations I can come up with for your piece of code working for you apart from me encountering an anomaly is either you have admin:admin defined in your orientdb-server-config.xml or you are issuing client.connect("root", "...") before the call to client.db_open.
from pyorient.
Yes, you're right, i've two root user, root and admin, you can find my server configuration here:
https://github.com/mogui/pyorient/blob/master/ci/orientdb-server-config.xml#L145.
But this is the right behaviour of the client, the client can't know the root access credentials.
Wrong user/password to [connect] to the remote OrientDB Server instance.
Get the user/password from the config/orientdb-server-config.xml file -
com.orientechnologies.orient.core.exception.OSecurityAccessException
This is an exception raised by orientDB.
Moreover, the binary protocol seems not to allow to open a database without a connection because OrientDB raise an exception.
Writing string (4+30=34 bytes): java.lang.NullPointerException [OChannelBinaryServer]
I have to check for this, but i think there is not a solution at the moment.
from pyorient.
I believe that should be possible since console.sh does seem to allow this while using the binary protocol (using "remote" connection mode and not "plocal"):
bash-4.2$ sh console.sh
orientdb> connect remote:localhost/test reader reader <--- reader:reader from OUser
Connecting to database [remote:localhost/test] with user 'reader'...OK
from pyorient.
Related Issues (20)
- pyorient not working with orientdb 3.0.0 HOT 33
- Performance PyOrient x Console HOT 5
- Protocol version 37 is not supported yet by this client. HOT 1
- query() got an unexpected keyword argument HOT 3
- graph.create_edge object has no attribute '_id' HOT 8
- Django Pyorient HOT 2
- Load Balancing HOT 1
- Using pyorient with DirectAccess
- Randomly fail to create new cluster
- Is it a dead project ? HOT 4
- PyOrient gives results that differ from OrientDB studio HOT 1
- Query doesn't return expected results
- How to write to OrientDB using transactions? (getting "quorum cannot be reached")
- What is the correctly way to delete edges with orientdb OGM in django rest framework? HOT 3
- How to get the last record in a query? HOT 1
- query_async is not working
- OrientDb Exception Message
- I fixed several issues and want to update the source (orient 3.2) and push to Conda Repo ...
- Server sent empty string HOT 1
- Get list of databases created 30 days ago?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyorient.